Skip to content

Commit

Permalink
Remove unused code about sequential conditions & fix test for step st…
Browse files Browse the repository at this point in the history
…arted
  • Loading branch information
AlexandreDecan committed Aug 20, 2018
1 parent 2403e1a commit 11da70e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions sismic/code/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ def evaluate_preconditions(self, obj, event: Optional[Event]=None) -> Iterator[s
}) # type: ignore

# Only needed if there is an invariant, a postcondition or a sequential condition
if len(getattr(obj, 'invariants', [])) > 0 or len(getattr(obj, 'postconditions', [])) > 0 or len(
getattr(obj, 'sequences', [])) > 0:
if len(getattr(obj, 'invariants', [])) > 0 or len(getattr(obj, 'postconditions', [])) > 0:
self._memory[id(obj)] = FrozenContext(self._context)

return filter(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_synchronised_time(self, microwave, property_statechart):

def test_empty_step(self, microwave, property_statechart):
microwave.execute()
assert property_statechart.queue.call_args_list[0][0][0] == MetaEvent('step started')
assert property_statechart.queue.call_args_list[0][0][0] == MetaEvent('step started', time=0)
assert property_statechart.queue.call_args_list[-1][0][0] == MetaEvent('step ended')

for call in property_statechart.queue.call_args_list:
Expand Down Expand Up @@ -56,13 +56,13 @@ def test_trace(self, microwave, property_statechart):
microwave.execute()

call_list = [
MetaEvent('step started'),
MetaEvent('step started', time=0),
MetaEvent('state entered', state='controller'),
MetaEvent('state entered', state='door closed'),
MetaEvent('state entered', state='closed without item'),
MetaEvent('step ended'),

MetaEvent('step started'),
MetaEvent('step started', time=0),
MetaEvent('event consumed', event=Event('door_opened')),
MetaEvent('state exited', state='closed without item'),
MetaEvent('state exited', state='door closed'),
Expand Down

0 comments on commit 11da70e

Please sign in to comment.