Beispiel #1
0
def load_statechart(context, path):
    with open(path) as f:
        context._statechart = import_from_yaml(f)
    context._interpreter = Interpreter(context._statechart)
    context._steps = log_trace(context._interpreter)

    context._automatic_execution = True

    context._events = []
    context._interpreter.bind(context._events.append)

    _execute_statechart(context, force_execution=True, execute_once=True)
Beispiel #2
0
 def setUp(self):
     with open('docs/examples/elevator/elevator.yaml') as f:
         sc = io.import_from_yaml(f)
     self.tested = Interpreter(sc)
     self.steps = log_trace(self.tested)
 def setUp(self):
     with open('docs/examples/elevator/elevator.yaml') as f:
         sc = io.import_from_yaml(f)
     self.tested = Interpreter(sc)
     self.steps = log_trace(self.tested)