setup: tox prep for upcoming black updates
[git-cola.git] / test / gitops_test.py
blob29fb7630c00cbe4b9a5304e15e296c04b8ee56ad
1 #!/usr/bin/env python
2 """Tests basic git operations: commit, log, config"""
3 from __future__ import absolute_import, division, unicode_literals
4 import unittest
6 from . import helper
9 class ColaBasicGitTestCase(helper.GitRepositoryTestCase):
10 def test_git_commit(self):
11 """Test running 'git commit' via cola.git"""
12 self.write_file('A', 'A')
13 self.write_file('B', 'B')
14 self.run_git('add', 'A', 'B')
16 self.git.commit(m='initial commit')
17 log = self.run_git('log', '--pretty=oneline')
19 self.assertEqual(len(log.splitlines()), 1)
21 def test_git_config(self):
22 """Test cola.git.config()"""
23 self.run_git('config', 'section.key', 'value')
24 value = self.git.config('section.key', get=True)
25 self.assertEqual(value, (0, 'value', ''))
28 if __name__ == '__main__':
29 unittest.main()