From 953689c8b31816d1870b780bf07063c117bbb5ad Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 16:08:04 -0400 Subject: [PATCH] test(orchestration_logic): mock send_result not send (Phase 2.13, fixes Phase 1.1 regression) Phase 1.1 + 1.2 migrated the production code to send_result(). The test_generate_tracks and test_generate_tickets tests mocked src.ai_client.send, causing "send was called 0 times" failures. Changes: - Replace patch(src.ai_client.send) with patch(src.ai_client.send_result) - Wrap mock return_value with Result(data=mock_response) - Add "from src.result_types import Result" import All 8 tests in tests/test_orchestration_logic.py pass (2 migrated + 6 unaffected tests). --- tests/test_orchestration_logic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_orchestration_logic.py b/tests/test_orchestration_logic.py index 1ff44224..c4948d79 100644 --- a/tests/test_orchestration_logic.py +++ b/tests/test_orchestration_logic.py @@ -4,6 +4,7 @@ from src import orchestrator_pm from src import multi_agent_conductor from src import conductor_tech_lead from src.models import Ticket, Track, WorkerContext +from src.result_types import Result def test_generate_tracks() -> None: mock_response = """ @@ -12,7 +13,7 @@ def test_generate_tracks() -> None: {"id": "track_2", "title": "Refactor", "goal": "decouple modules", "type": "refactor"} ] """ - with patch("src.ai_client.send", return_value=mock_response): + with patch("src.ai_client.send_result", return_value=Result(data=mock_response)): tracks = orchestrator_pm.generate_tracks("Develop feature X", {}, []) assert len(tracks) == 2 assert tracks[0]["id"] == "track_1" @@ -25,7 +26,7 @@ def test_generate_tickets() -> None: {"id": "T2", "description": "task 2", "depends_on": ["T1"]} ] """ - with patch("src.ai_client.send", return_value=mock_response): + with patch("src.ai_client.send_result", return_value=Result(data=mock_response)): tickets = conductor_tech_lead.generate_tickets("Track goal", "code skeletons") assert len(tickets) == 2 assert tickets[0]["id"] == "T1"