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).
This commit is contained in:
ed
2026-06-15 20:28:41 -04:00
parent 26e1b65298
commit 13f32f52e0
+2 -1
View File
@@ -5,6 +5,7 @@ from src import app_controller
from src import aggregate from src import aggregate
from pathlib import Path from pathlib import Path
from unittest.mock import MagicMock, patch from unittest.mock import MagicMock, patch
from src.result_types import Result
def test_persona_aggregation_strategy(): def test_persona_aggregation_strategy():
p = Persona(name="test_persona", aggregation_strategy="summarize") 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.summarize.summarise_file")
@patch("src.multi_agent_conductor.ai_client.send_result") @patch("src.multi_agent_conductor.ai_client.send_result")
def test_run_worker_lifecycle_uses_strategy(mock_send, mock_summarise, tmp_path): 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" mock_summarise.return_value = "fake summary"
test_file = tmp_path / "test.py" test_file = tmp_path / "test.py"