Skip to content

Commit 10bd0dd

Browse files
author
zhenwei-li
committed
the git config test suite
1 parent 6f8c2a9 commit 10bd0dd

3 files changed

Lines changed: 33 additions & 25 deletions

File tree

src/com/dvsnier/git/config/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def global_info(self):
1616

1717
def local_info(self):
1818
'the local git information'
19-
return execute(['git config --global --list'])
19+
return execute(['git config --local --list'])

tests/com/dvsnier/git/checkout/test_checkout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setUpClass(cls):
1818
cls._branch.set_current_branch_name(cls._branch.get_branch())
1919

2020
def setUp(self):
21-
return super(Test_Checkout, self).setUp()
21+
super(Test_Checkout, self).setUp()
2222

2323
def test_branch_checkout(self):
2424
branch_checkout = Checkout()
@@ -29,7 +29,7 @@ def test_branch_checkout(self):
2929
# print("the test branch_checkout is succeed.")
3030

3131
def tearDown(self):
32-
return super(Test_Checkout, self).tearDown()
32+
super(Test_Checkout, self).tearDown()
3333

3434
@classmethod
3535
def tearDownClass(cls):
Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,51 @@
11
# -*- coding:utf-8 -*-
22

3-
from com.dvsnier.git.config.config import Config
3+
import logging
44
import unittest
55

6+
from com.dvsnier.git.config.config import Config
7+
from com.dvsnier.git.git import Git
8+
69

710
class Test_Config(unittest.TestCase):
811
''' the test xxx '''
12+
913
@classmethod
1014
def setUpClass(cls):
1115
print("...the set up...")
12-
print
16+
print('')
17+
cls._git = Git()
18+
cls._git.config()
19+
cls._config = Config()
1320

1421
def setUp(self):
15-
return super(Test_Config, self).setUp()
16-
17-
def test_global_info(self):
18-
config = Config()
19-
info = config.global_info()
20-
self.assertIsNotNone(info, 'test_global_info is error.')
21-
print(info)
22-
print "the test global info is succeed."
23-
pass
24-
25-
def test_local_info(self):
26-
config = Config()
27-
info = config.local_info()
28-
self.assertIsNotNone(info, 'test_local_info is error.')
29-
print(info)
30-
print "the test local info is succeed."
31-
pass
22+
super(Test_Config, self).setUp()
23+
logging.debug('the start setUp item tests.')
24+
25+
def test_0_global_info(self):
26+
info = Test_Config._config.global_info()
27+
self.assertIsNotNone(info, 'test_0_global_info is error.')
28+
logging.debug(info)
29+
# print(info)
30+
# print("the test global info is succeed.")
31+
32+
def test_1_local_info(self):
33+
info = Test_Config._config.local_info()
34+
self.assertIsNotNone(info, 'test_1_local_info is error.')
35+
logging.debug(info)
36+
# print(info)
37+
# print("the test local info is succeed.")
3238

3339
def tearDown(self):
34-
return super(Test_Config, self).tearDown()
40+
super(Test_Config, self).tearDown()
41+
logging.debug('the end tearDown item tests.')
3542

3643
@classmethod
3744
def tearDownClass(cls):
38-
print
45+
print('')
3946
print("...the tear down...")
4047

4148

4249
if __name__ == '__main__':
43-
unittest.main()
50+
suite = unittest.TestLoader().loadTestsFromTestCase(Test_Config)
51+
unittest.TextTestRunner(verbosity=2).run(suite)

0 commit comments

Comments
 (0)