forked from git-cola/git-cola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitops_test.py
30 lines (21 loc) · 863 Bytes
/
gitops_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
"""Tests basic git operations: commit, log, config"""
from __future__ import absolute_import, division, unicode_literals
import unittest
from . import helper
class ColaBasicGitTestCase(helper.GitRepositoryTestCase):
def test_git_commit(self):
"""Test running 'git commit' via cola.git"""
self.write_file('A', 'A')
self.write_file('B', 'B')
self.run_git('add', 'A', 'B')
self.git.commit(m='initial commit')
log = self.run_git('log', '--pretty=oneline')
self.assertEqual(len(log.splitlines()), 1)
def test_git_config(self):
"""Test cola.git.config()"""
self.run_git('config', 'section.key', 'value')
value = self.git.config('section.key', get=True)
self.assertEqual(value, (0, 'value', ''))
if __name__ == '__main__':
unittest.main()