test(suite): update all tests for streaming/locking architecture and mock parity

This commit is contained in:
2026-03-02 10:15:41 -05:00
parent 5de253b15b
commit 0b5552fa01
14 changed files with 130 additions and 77 deletions

View File

@@ -1,6 +1,6 @@
from typing import Generator
import pytest
from unittest.mock import MagicMock, patch, AsyncMock
from unittest.mock import MagicMock, patch, AsyncMock, ANY
import asyncio
import time
from gui_2 import App
@@ -68,7 +68,11 @@ def test_user_request_integration_flow(mock_app: App) -> None:
while not mock_send.called and time.time() - start_time < 5:
time.sleep(0.1)
assert mock_send.called, "ai_client.send was not called within timeout"
mock_send.assert_called_once_with("Context", "Hello AI", ".", [], "History")
mock_send.assert_called_once_with(
"Context", "Hello AI", ".", [], "History",
pre_tool_callback=ANY,
qa_callback=ANY
)
# 4. Wait for the response to propagate to _pending_gui_tasks and update UI
# We call _process_pending_gui_tasks manually to simulate a GUI frame update.
start_time = time.time()