Ejemplo n.º 1
0
 def test_nested_machine_events(self):
     states, trans = make_nested_machine(False)
     hsm = HSM(states, trans)
     event_set = get_events(hsm.flattened, trans)
     assert event_set == set([A, B, C, AB_ex, AC_ex, BC_ex, AB_loc, AC_loc,
                              BC_loc, BA_ex, CA_ex, CB_ex, BA_loc, CA_loc,
                              CB_loc])
Ejemplo n.º 2
0
 def test_get_events(self):
     event_set = get_events(self.hsm.flattened, self.trans)
     # RootEventB shouldn't appear in event_set since nobody explicitly
     # listens to it, only its subclasses
     assert event_set == set([RootEventA, RootEventC, A1, A2, B1, C1, C2,
                              C11, C12, C21, C22])
Ejemplo n.º 3
0
 def test_miro_machine_events(self):
     states, trans = make_miro_machine(use_logging=False)
     hsm = HSM(states, trans)
     event_set = get_events(hsm.flattened, trans)
     assert event_set == set([A, B, C, D, E, F, G, H, I, TERMINATE])