widgets: flake8 and pylint fixes
[git-cola.git] / test / gitops_test.py
blob5bae4a695f64bc434f83f6f04fd28cd6f0781b41
1 """Tests basic git operations: commit, log, config"""
2 # pylint: disable=redefined-outer-name
3 from __future__ import absolute_import, division, print_function, unicode_literals
5 from . import helper
6 from .helper import app_context
9 # These assertions make flake8 happy. It considers them unused imports otherwise.
10 assert app_context is not None
13 def test_git_commit(app_context):
14 """Test running 'git commit' via cola.git"""
15 helper.write_file('A', 'A')
16 helper.write_file('B', 'B')
17 helper.run_git('add', 'A', 'B')
19 app_context.git.commit(m='initial commit')
20 log = helper.run_git('-c', 'log.showsignature=false', 'log', '--pretty=oneline')
22 expect = 1
23 actual = len(log.splitlines())
24 assert expect == actual
27 def test_git_config(app_context):
28 """Test cola.git.config()"""
29 helper.run_git('config', 'section.key', 'value')
30 expect = (0, 'value', '')
31 actual = app_context.git.config('section.key', get=True)
32 assert expect == actual