fetch: add ability to fetch into a remote tracking branch
[git-cola.git] / test / gitops_test.py
blob14c2925de28412a5aa4d87066c9af0c85c8a943b
1 """Tests basic git operations: commit, log, config"""
2 from . import helper
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')
19 expect = 1
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