Skip to content

Commit

Permalink
teststory_from_trace generates a *step* event at the beginning of eac…
Browse files Browse the repository at this point in the history
…h step.
  • Loading branch information
AlexandreDecan committed Jan 21, 2016
1 parent f51292a commit 62e7f7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The YAML format of a statechart also changed, look carefully at the changelog an
``state_for``, ``parent_for``, ``children_for``.
- (Added) Steps: ``__eq__`` for ``MacroStep`` and ``MicroStep``.
- (Added) Stories: ``tell_by_step`` method for a ``Story``.
- (Added) Testing: ``teststory_from_trace`` generates a *step* event at the beginning of each step.
- (Added) Module: a new exceptions hierarchy (see ``exceptions`` module).
The new exceptions are used in place of the old ones (``Warning``, ``AssertionError`` and ``ValueError``).
- (Changed) YAML: uppermost *states:* should be replaced by *initial state:* and can contain at most one state.
Expand Down
3 changes: 3 additions & 0 deletions sismic/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def teststory_from_trace(trace: list) -> Story:
- the story begins with a *started* event.
- the delay between pairs of consecutive steps creates a *pause* instance.
- each time a step begins, a *step* event is created.
- each time an event is consumed, a *consumed* event is created.
the consumed event is available through the *event* attribute.
- each time a state is exited, an *exited* event is created.
Expand Down Expand Up @@ -46,6 +47,8 @@ def teststory_from_trace(trace: list) -> Story:
story.append(Pause(macrostep.time - time))
time = macrostep.time

story.append(Event('step'))

if macrostep.event:
story.append(Event('consumed', event=macrostep.event))

Expand Down

0 comments on commit 62e7f7b

Please sign in to comment.