From 13f32f52e02199a11396d815cac0af68deb32254 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 20:28:41 -0400 Subject: [PATCH] test(tiered_aggregation): wrap mock_send return in Result(data=...) (Phase 2 follow-up) The test_run_worker_lifecycle_uses_strategy test in test_tiered_aggregation.py mocked src.multi_agent_conductor.ai_client.send_result with a return_value of a raw string. The production code does "if not result.ok:" which fails on raw strings. 3/3 tests in test_tiered_aggregation.py pass (was 2/3). --- tests/test_tiered_aggregation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_tiered_aggregation.py b/tests/test_tiered_aggregation.py index 105eabcf..f35f3a57 100644 --- a/tests/test_tiered_aggregation.py +++ b/tests/test_tiered_aggregation.py @@ -5,6 +5,7 @@ from src import app_controller from src import aggregate from pathlib import Path from unittest.mock import MagicMock, patch +from src.result_types import Result def test_persona_aggregation_strategy(): p = Persona(name="test_persona", aggregation_strategy="summarize") @@ -42,7 +43,7 @@ def test_app_controller_do_generate_uses_persona_strategy(mock_build): @patch("src.summarize.summarise_file") @patch("src.multi_agent_conductor.ai_client.send_result") def test_run_worker_lifecycle_uses_strategy(mock_send, mock_summarise, tmp_path): - mock_send.return_value = "fake response" + mock_send.return_value = Result(data="fake response") mock_summarise.return_value = "fake summary" test_file = tmp_path / "test.py"