From c59bac59f23ae75b2a61a9f712572a7146799ae0 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 16:49:11 -0400 Subject: [PATCH] test(gui2_mcp): migrate to send_result() (Phase 2.5) The test_mcp_tool_call_is_dispatched test calls ai_client.send() and asserts the MCP dispatch function was called. Migrating to send_result() + assert result.ok. Changes: - Rename ai_client.send(...) to ai_client.send_result(...) - Add assert result.ok - Add "from src.result_types import Result" import 1 test passes. --- tests/test_gui2_mcp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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