|
1 | 1 | # -*- coding:utf-8 -*- |
2 | 2 |
|
3 | | -from com.dvsnier.git.git import Git |
4 | 3 | import logging |
5 | 4 | import unittest |
6 | 5 |
|
| 6 | +from com.dvsnier.git.git import Git |
7 | 7 |
|
8 | 8 | class Test_Git(unittest.TestCase): |
9 | 9 | ''' the test git ''' |
| 10 | + |
10 | 11 | @classmethod |
11 | 12 | def setUpClass(cls): |
12 | 13 | print("...the set up...") |
13 | | - print |
| 14 | + print('') |
| 15 | + cls._git = Git() |
| 16 | + cls._git.config() |
14 | 17 |
|
15 | 18 | def setUp(self): |
16 | | - return super(Test_Git, self).setUp() |
| 19 | + super(Test_Git, self).setUp() |
17 | 20 |
|
18 | 21 | def test_config(self): |
19 | 22 | ''' the test config |
20 | 23 | note: |
21 | 24 | 1. the currently, only one process instance log object is supported. |
22 | 25 | 2. the following consideration is to support multi process and multi instance log objects |
23 | 26 | ''' |
24 | | - git = Git() |
25 | | - self.assertIsNotNone(git, 'test_config is error.') |
26 | | - git.config() |
27 | | - # git.config(output_dir_name='test_git') |
28 | | - # git.config(file_name='record') |
29 | | - # git.config(output_dir_name='test_git', file_name='record') |
| 27 | + self.assertIsNotNone(Test_Git._git, 'test_config is error.') |
| 28 | + # Test_Git._git.config(output_dir_name='test_git') |
| 29 | + # Test_Git._git.config(file_name='record') |
| 30 | + # Test_Git._git.config(output_dir_name='test_git', file_name='record') |
30 | 31 | logging.warn('the test config is succeed.') |
31 | 32 | print("the test config is succeed.") |
32 | 33 |
|
33 | 34 | def tearDown(self): |
34 | | - return super(Test_Git, self).tearDown() |
| 35 | + super(Test_Git, self).tearDown() |
35 | 36 |
|
36 | 37 | @classmethod |
37 | 38 | def tearDownClass(cls): |
38 | | - print |
| 39 | + print('') |
39 | 40 | print("...the tear down...") |
40 | 41 |
|
41 | 42 |
|
42 | 43 | if __name__ == '__main__': |
43 | | - unittest.main() |
| 44 | + suite = unittest.TestLoader().loadTestsFromTestCase(Test_Git) |
| 45 | + unittest.TextTestRunner(verbosity=2).run(suite) |
0 commit comments