Skip to content

Commit 1d4f79d

Browse files
tests tweak
1 parent a9ccc8d commit 1d4f79d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_applets/test_applet_scans.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ async def watch_activities():
5151
# wait for events to be processed
5252
for _ in range(120):
5353
scans = [s async for s in bbot_server.get_scans()]
54+
5455
if len(scans) == 1 and scans[0].status == "FINISHED":
55-
break
56+
scan_activities = [a for a in activities if a.type.startswith("SCAN_")]
57+
scan_statuses = [a.detail["scan_status"] for a in scan_activities]
58+
if scan_activities == ["SCAN_STATUS", "SCAN_STATUS"] and scan_statuses == ["RUNNING", "FINISHED"]:
59+
break
60+
5661
await asyncio.sleep(0.5)
5762
else:
5863
assert False, "Scan did not finish"
5964

60-
assert [a.type for a in activities if a.type.startswith("SCAN_")] == ["SCAN_STATUS", "SCAN_STATUS"]
61-
assert [a.detail["scan_status"] for a in activities if a.type.startswith("SCAN_")] == ["RUNNING", "FINISHED"]
62-
6365
activity_task.cancel()
6466
with suppress(asyncio.CancelledError):
6567
await activity_task

0 commit comments

Comments
 (0)