tests: prefer functions over methods
[git-cola.git] / test / gitops_test.py
blob988310966f38c9fd392e83964672be1032b9d990
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):
11 def test_git_commit(self):
12 """Test running 'git commit' via cola.git"""
13 self.write_file('A', 'A')
14 self.write_file('B', 'B')
15 self.run_git('add', 'A', 'B')
17 self.git.commit(m='initial commit')
18 log = self.run_git('log', '--pretty=oneline')
20 self.assertEqual(len(log.splitlines()), 1)
22 def test_git_config(self):
23 """Test cola.git.config()"""
24 self.run_git('config', 'section.key', 'value')
25 value = self.git.config('section.key', get=True)
26 self.assertEqual(value, (0, 'value', ''))
29 if __name__ == '__main__':
30 unittest.main()