Skip to content

Commit

Permalink
Tests are actually good and can catch bugs if you let them.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Jun 21, 2024
1 parent ec01590 commit ede5316
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions api/src/opentrons/protocol_engine/state/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,20 @@ def handle_action(self, action: Action) -> None: # noqa: C901
self._state.run_started_at = (
self._state.run_started_at or action.requested_at
)
self._state.queue_status = (
QueueStatus.AWAITING_RECOVERY
if self._state.queue_status == QueueStatus.AWAITING_RECOVERY_PAUSED
else QueueStatus.RUNNING
)
match self._state.queue_status:
case QueueStatus.SETUP:
self._state.queue_status = (
QueueStatus.PAUSED
if self._state.is_door_blocking
else QueueStatus.RUNNING
)
case QueueStatus.AWAITING_RECOVERY_PAUSED:
self._state.queue_status = QueueStatus.AWAITING_RECOVERY
case QueueStatus.PAUSED | QueueStatus.RUNNING:
self._state.queue_status = QueueStatus.RUNNING
case QueueStatus.AWAITING_RECOVERY:
# Should not be possible. See validate_action_allowed().
pass

elif isinstance(action, PauseAction):
self._state.queue_status = QueueStatus.PAUSED
Expand Down

0 comments on commit ede5316

Please sign in to comment.