19
19
import sys
20
20
sys .path .append ('../grc' )
21
21
import Step
22
+ import ControllWords
23
+ import Output
22
24
23
25
class TestStringMethod (unittest .TestCase ):
24
26
25
27
def test_step_stepObj_init (self ):
26
28
27
- stepObj = Step .Step .StepObj ("lab\n \code:cod" )
29
+ control_words = ControllWords .ControlWords (Output .Output ())
30
+
31
+ stepObj = Step .Step .StepObj ("lab\n \code:cod" , control_words )
28
32
29
33
self .assertEqual (stepObj .description , ['lab' , '\code:cod' ])
30
34
self .assertEqual (stepObj .label , 'lab' )
@@ -33,7 +37,9 @@ def test_step_stepObj_init(self):
33
37
34
38
def test_step_stepObj_addCodeLine (self ):
35
39
36
- stepObj = Step .Step .StepObj ('' )
40
+ control_words = ControllWords .ControlWords (Output .Output ())
41
+
42
+ stepObj = Step .Step .StepObj ('' , control_words )
37
43
38
44
stepObj .add_code_line ('cod' )
39
45
@@ -42,7 +48,9 @@ def test_step_stepObj_addCodeLine(self):
42
48
43
49
def test_step_stepObj_addLabelLine (self ):
44
50
45
- stepObj = Step .Step .StepObj ('' )
51
+ control_words = ControllWords .ControlWords (Output .Output ())
52
+
53
+ stepObj = Step .Step .StepObj ('' , control_words )
46
54
47
55
stepObj .add_label_line ('lab' )
48
56
@@ -51,13 +59,17 @@ def test_step_stepObj_addLabelLine(self):
51
59
52
60
def test_step_stepObj_str (self ):
53
61
54
- stepObj = Step .Step .StepObj ("lab\n \code:cod" )
62
+ control_words = ControllWords .ControlWords (Output .Output ())
63
+
64
+ stepObj = Step .Step .StepObj ("lab\n \code:cod" , control_words )
55
65
56
66
self .assertEqual (str (stepObj ), "{'code': 'cod', 'description': ['lab', '\\ \\ code:cod'], 'label': 'lab'}" )
57
67
58
68
def test_step_init (self ):
59
69
60
- step = Step .Step (7 , 'abc\n \code: ghi' , 'def\n \code:jkl' )
70
+ control_words = ControllWords .ControlWords (Output .Output ())
71
+
72
+ step = Step .Step (7 , 'abc\n \code: ghi' , 'def\n \code:jkl' , control_words )
61
73
62
74
self .assertEqual (step .id , 7 )
63
75
@@ -72,7 +84,9 @@ def test_step_init(self):
72
84
73
85
def test_step_str (self ):
74
86
75
- step = Step .Step (7 , 'abc\n \code: ghi' , 'def\n \code:jkl' )
87
+ control_words = ControllWords .ControlWords (Output .Output ())
88
+
89
+ step = Step .Step (7 , 'abc\n \code: ghi' , 'def\n \code:jkl' , control_words )
76
90
77
91
self .assertEqual ("'action': " in str (step ), True )
78
92
self .assertEqual ("'node': " in str (step ), True )
0 commit comments