We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28e8093 commit af6f42aCopy full SHA for af6f42a
test/test_pysm.py
@@ -1200,11 +1200,15 @@ def do(event):
1200
m.dispatch(_e('do'))
1201
1202
1203
-def test_add_states():
1204
- # TODO Implement
1205
- pass
1206
-
+def test_add_states_and_set_initial_state():
+ m = StateMachine('m')
+ s0 = StateMachine('s0')
+ s1 = StateMachine('s1')
1207
+ s2 = State('s2')
1208
-def test_set_initial_state():
1209
1210
+ m.add_states(s0, s1, s2)
+ assert all(state in m.states for state in (s0, s1, s2))
1211
+ assert m.initial_state is None
1212
+ m.set_initial_state(s0)
1213
+ m.initialize()
1214
+ assert m.initial_state is s0
0 commit comments