File tree Expand file tree Collapse file tree 1 file changed +36
-23
lines changed Expand file tree Collapse file tree 1 file changed +36
-23
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*-
3
3
import unittest
4
- from structural .facade import TestRunner
4
+ from structural .facade import TestRunner , TC1 , TC2 , TC3
5
5
6
6
7
7
class TestRunnerFacilities (unittest .TestCase ):
8
8
9
9
def setUp (self ):
10
- self .runner = TestRunner ()
11
- self .average_result = """###### In Test 1 ######
12
- Setting up
13
- Running test
14
- Tearing down
15
- Test Finished
16
-
17
- ###### In Test 2 ######
18
- Setting up
19
- Running test
20
- Tearing down
21
- Test Finished
22
-
23
- ###### In Test 3 ######
24
- Setting up
25
- Running test
26
- Tearing down
27
- Test Finished"""
28
-
29
- def test_bunch_launch (self ):
10
+ self .tc = TC1
11
+ self .average_result_tc1 = "###### In Test 1 ######\n " + \
12
+ "Setting up\n " + \
13
+ "Running test\n " + \
14
+ "Tearing down\n " + \
15
+ "Test Finished"
16
+
17
+ def test_tc1_output (self ):
30
18
import sys
31
19
try :
32
20
from io import StringIO
33
21
except :
34
22
from StringIO import StringIO
35
23
out = StringIO ()
36
24
sys .stdout = out
37
- self .runner . runAll ( )
25
+ self .tc . run ( self )
38
26
output = out .getvalue ().strip ()
39
- self .assertEqual (output , self .average_result )
27
+ self .assertEqual (output , self .average_result_tc1 )
28
+
29
+
30
+ # ###### In Test 2 ######
31
+ # Setting up
32
+ # Running test
33
+ # Tearing down
34
+ # Test Finished
35
+
36
+ # ###### In Test 3 ######
37
+ # Setting up
38
+ # Running test
39
+ # Tearing down
40
+ # Test Finished"""
41
+
42
+ # def test_bunch_launch(self):
43
+ # import sys
44
+ # try:
45
+ # from io import StringIO
46
+ # except:
47
+ # from StringIO import StringIO
48
+ # out = StringIO()
49
+ # sys.stdout = out
50
+ # self.runner.runAll()
51
+ # output = out.getvalue().strip()
52
+ # self.assertEqual(output, self.average_result)
40
53
41
54
You can’t perform that action at this time.
0 commit comments