add readme, move testing function to lib
This commit is contained in:
parent
2fb8318506
commit
8b3f543bda
5 changed files with 118 additions and 10 deletions
|
|
@ -134,3 +134,14 @@ def run_scenario(input_trace, expected_output_trace, statechart_class, INITIAL,
|
|||
elif verbose:
|
||||
print_diff()
|
||||
return True
|
||||
|
||||
def run_scenarios(scenarios, statechart_class, initial, idempotent, verbose=True):
|
||||
ok = True
|
||||
for scenario in scenarios:
|
||||
print(f"Running scenario: {scenario["name"]}")
|
||||
ok = run_scenario(scenario["input_events"], scenario["output_events"], statechart_class, initial, idempotent, verbose=verbose) and ok
|
||||
print("--------")
|
||||
if ok:
|
||||
print("All scenarios passed.")
|
||||
else:
|
||||
print("Some scenarios failed.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue