Module bdd¶
-
sismic.bdd.execute_bdd(statechart, feature_filepaths, *, step_filepaths=None, property_statecharts=None, interpreter_klass=<class 'sismic.interpreter.default.Interpreter'>, debug_on_error=False, behave_parameters=None)¶ Execute BDD tests for a statechart.
Parameters: - statechart (
Statechart) – statechart to test - feature_filepaths (
List[str]) – list of filepaths to feature files. - step_filepaths (
Optional[List[str]]) – list of filepaths to step definitions. - property_statecharts (
Optional[List[Statechart]]) – list of property statecharts - interpreter_klass (
Callable[[Statechart],Interpreter]) – a callable that accepts a statechart and an optional clock and returns an Interpreter - debug_on_error (
bool) – set to True to drop to (i)pdb in case of error. - behave_parameters (
Optional[List[str]]) – additional CLI parameters used by Behave (see http://behave.readthedocs.io/en/latest/behave.html#command-line-arguments)
Return type: Returns: exit code of behave CLI.
- statechart (
-
sismic.bdd.map_action(step_text, existing_step_or_steps)¶ Map new “given”/”when” steps to one or many existing one(s). Parameters are propagated to the original step(s) as well, as expected.
Examples:
- map_action(‘I open door’, ‘I send event open_door’)
- map_action(‘Event {name} has to be sent’, ‘I send event {name}’)
- map_action(‘I do two things’, [‘First thing to do’, ‘Second thing to do’])
Parameters: Return type: None
-
sismic.bdd.map_assertion(step_text, existing_step_or_steps)¶ Map a new “then” step to one or many existing one(s). Parameters are propagated to the original step(s) as well, as expected.
map_assertion(‘door is open’, ‘state door open is active’) map_assertion(‘{x} seconds elapsed’, ‘I wait for {x} seconds’) map_assertion(‘assert two things’, [‘first thing to assert’, ‘second thing to assert’])
Parameters: Return type: None