diff --git a/tests/test_gui2_mcp.py b/tests/test_gui2_mcp.py index 97e9945b..6a7e7dd5 100644 --- a/tests/test_gui2_mcp.py +++ b/tests/test_gui2_mcp.py @@ -2,6 +2,7 @@ import unittest.mock from unittest.mock import patch, MagicMock from src.gui_2 import App from src import ai_client +from src.result_types import Result def test_mcp_tool_call_is_dispatched(app_instance: App) -> None: """ @@ -44,12 +45,13 @@ def test_mcp_tool_call_is_dispatched(app_instance: App) -> None: mock_chat.send_message.side_effect = [mock_response_with_tool, mock_response_final] ai_client.set_provider("gemini", "mock-model") # 5. Call the send function - ai_client.send( + result = ai_client.send_result( md_content="some context", user_message="read the file", base_dir=".", file_items=[], discussion_history="" ) + assert result.ok # 6. Assert that the MCP dispatch function was called mock_dispatch.assert_called_once_with("read_file", {"file_path": "test.txt"}) \ No newline at end of file