test(suite): update all tests for streaming/locking architecture and mock parity
This commit is contained in:
@@ -67,14 +67,16 @@ def test_cb_plan_epic_launches_thread(app_instance: App) -> None:
|
||||
# Wait for the background thread to finish (it should be quick with mocks)
|
||||
max_wait = 5
|
||||
start_time = time.time()
|
||||
while len(app_instance._pending_gui_tasks) < 2 and time.time() - start_time < max_wait:
|
||||
while len(app_instance._pending_gui_tasks) < 3 and time.time() - start_time < max_wait:
|
||||
time.sleep(0.1)
|
||||
assert len(app_instance._pending_gui_tasks) == 2
|
||||
task1 = app_instance._pending_gui_tasks[0]
|
||||
assert len(app_instance._pending_gui_tasks) == 3
|
||||
task0 = app_instance._pending_gui_tasks[0]
|
||||
assert task0['action'] == 'custom_callback'
|
||||
task1 = app_instance._pending_gui_tasks[1]
|
||||
assert task1['action'] == 'handle_ai_response'
|
||||
assert task1['payload']['stream_id'] == 'Tier 1'
|
||||
assert task1['payload']['text'] == json.dumps(mock_tracks, indent=2)
|
||||
task2 = app_instance._pending_gui_tasks[1]
|
||||
task2 = app_instance._pending_gui_tasks[2]
|
||||
assert task2['action'] == 'show_track_proposal'
|
||||
assert task2['payload'] == mock_tracks
|
||||
mock_get_history.assert_called_once()
|
||||
|
||||
Reference in New Issue
Block a user