Skip to content

Commit

Permalink
added explicit checks for events
Browse files Browse the repository at this point in the history
  • Loading branch information
ZohebShaikh committed Sep 6, 2024
1 parent 896fc4e commit 3e8a429
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions tests/system_tests/test_blueapi_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,34 +221,32 @@ def on_event(event: AnyEvent):
client_with_stomp.run_task(_SIMPLE_TASK, on_event=on_event)
assert isinstance(all_events[0], WorkerEvent) and all_events[0].task_status
task_id = all_events[0].task_status.task_id
running_event = WorkerEvent(
state=WorkerState.RUNNING,
task_status=TaskStatus(
task_id=task_id,
task_complete=False,
task_failed=False,
assert all_events == [
WorkerEvent(
state=WorkerState.RUNNING,
task_status=TaskStatus(
task_id=task_id,
task_complete=False,
task_failed=False,
),
),
)
pending_event = WorkerEvent(
state=WorkerState.IDLE,
task_status=TaskStatus(
task_id=task_id,
task_complete=False,
task_failed=False,
WorkerEvent(
state=WorkerState.IDLE,
task_status=TaskStatus(
task_id=task_id,
task_complete=False,
task_failed=False,
),
),
)
complete_event = WorkerEvent(
state=WorkerState.IDLE,
task_status=TaskStatus(
task_id=task_id,
task_complete=True,
task_failed=False,
WorkerEvent(
state=WorkerState.IDLE,
task_status=TaskStatus(
task_id=task_id,
task_complete=True,
task_failed=False,
),
),
)
assert running_event in all_events
assert pending_event in all_events
assert complete_event in all_events
assert len(all_events) == 3
]


def test_get_current_state_of_environment(client: BlueapiClient):
Expand Down

0 comments on commit 3e8a429

Please sign in to comment.