|
1 | 1 | # -*- coding:utf-8 -*- |
2 | 2 |
|
3 | | -from com.dvsnier.git.config.config import Config |
| 3 | +import logging |
4 | 4 | import unittest |
5 | 5 |
|
| 6 | +from com.dvsnier.git.config.config import Config |
| 7 | +from com.dvsnier.git.git import Git |
| 8 | + |
6 | 9 |
|
7 | 10 | class Test_Config(unittest.TestCase): |
8 | 11 | ''' the test xxx ''' |
| 12 | + |
9 | 13 | @classmethod |
10 | 14 | def setUpClass(cls): |
11 | 15 | print("...the set up...") |
12 | | - print |
| 16 | + print('') |
| 17 | + cls._git = Git() |
| 18 | + cls._git.config() |
| 19 | + cls._config = Config() |
13 | 20 |
|
14 | 21 | 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.") |
32 | 38 |
|
33 | 39 | def tearDown(self): |
34 | | - return super(Test_Config, self).tearDown() |
| 40 | + super(Test_Config, self).tearDown() |
| 41 | + logging.debug('the end tearDown item tests.') |
35 | 42 |
|
36 | 43 | @classmethod |
37 | 44 | def tearDownClass(cls): |
38 | | - print |
| 45 | + print('') |
39 | 46 | print("...the tear down...") |
40 | 47 |
|
41 | 48 |
|
42 | 49 | if __name__ == '__main__': |
43 | | - unittest.main() |
| 50 | + suite = unittest.TestLoader().loadTestsFromTestCase(Test_Config) |
| 51 | + unittest.TextTestRunner(verbosity=2).run(suite) |
0 commit comments