Skip to content

Commit

Permalink
Merge pull request #57 from alphatwirl/dev
Browse files Browse the repository at this point in the history
Update state transitions
  • Loading branch information
TaiSakuma authored Jun 30, 2024
2 parents b03b7d7 + 724d948 commit 9c24ae2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion atpbar/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def flush(self) -> 'State':
return self

def shutdown(self) -> 'State':
return self
return Initial(callback=self._callback)


class Initial(State):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,11 @@ def shutdown(self) -> None:
prev = self.state
self.callback.reset_mock()
self.state = prev.shutdown()
assert isinstance(self.state, Initial)
match prev:
case Active():
assert isinstance(self.state, Initial)
assert self.callback.mock_calls == [call.shutdown_in_active()]
case _:
assert self.state is prev
assert self.callback.mock_calls == []


Expand Down

0 comments on commit 9c24ae2

Please sign in to comment.