1 """Tests basic git operations: commit, log, config"""
3 from .helper
import app_context
6 # Prevent unused imports lint errors.
7 assert app_context
is not None
10 def test_git_commit(app_context
):
11 """Test running 'git commit' via cola.git"""
12 helper
.write_file('A', 'A')
13 helper
.write_file('B', 'B')
14 helper
.run_git('add', 'A', 'B')
16 app_context
.git
.commit(m
='initial commit')
17 log
= helper
.run_git('-c', 'log.showsignature=false', 'log', '--pretty=oneline')
20 actual
= len(log
.splitlines())
21 assert expect
== actual
24 def test_git_config(app_context
):
25 """Test cola.git.config()"""
26 helper
.run_git('config', 'section.key', 'value')
27 expect
= (0, 'value', '')
28 actual
= app_context
.git
.config('section.key', get
=True)
29 assert expect
== actual