File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 33import unittest
44sys .path .append ('../src' )
55
6- test = 2
6+ test = [2 ]
7+
8+
9+ def setTest (value ):
10+ """Set the test variable to the value specified"""
11+ test [0 ] = value
12+
13+
14+ def getTest ():
15+ """Return the value of test variable"""
16+ return test [0 ]
717
818
919def everFalse ():
@@ -23,15 +33,14 @@ def testPrint():
2333
2434def setTestTo3 ():
2535 """Sets Test to 3"""
26- global test # Needed to modify global copy of globvar
27- print (test )
28- test = 3
29- print (test )
36+ print (getTest ())
37+ setTest (3 )
38+ print (getTest ())
3039
3140
3241def printTest ():
3342 """Print Test"""
34- print ("Test: " , test )
43+ print ("Test: " , getTest () )
3544
3645
3746class TestBaseStateMachine (unittest .TestCase ):
@@ -164,8 +173,7 @@ def test5(self):
164173
165174 def test6 (self ):
166175 """Test 6 for state machine"""
167- global test
168- test = 2
176+ setTest (2 )
169177 sm = StateMachine ("../sample/sample6.xml" )
170178
171179 sm .LoadStateMachine ()
You can’t perform that action at this time.
0 commit comments