From 81882c398e0266e500fd55bd9cdcb05d5e6f4601 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 13:57:47 -0400 Subject: [PATCH] test(headless_service): adapt test_generate_endpoint to send_result (doeh cleanup Phase 2.5) --- tests/test_headless_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_headless_service.py b/tests/test_headless_service.py index 066f2086..4092efe8 100644 --- a/tests/test_headless_service.py +++ b/tests/test_headless_service.py @@ -8,6 +8,7 @@ from fastapi.testclient import TestClient sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) from src.app_controller import AppController +from src.result_types import Result class TestHeadlessAPI(unittest.TestCase): def setUp(self) -> None: @@ -55,7 +56,7 @@ class TestHeadlessAPI(unittest.TestCase): self.assertIn("not configured", response.json()["detail"]) def test_generate_endpoint(self) -> None: - with patch('src.ai_client.send', return_value="AI Response"), \ + with patch('src.ai_client.send_result', return_value=Result(data="AI Response")), \ patch('src.app_controller.AppController._do_generate', return_value=("md", "path", [], "stable", "disc")): payload = {"prompt": "test prompt", "auto_add_history": False} response = self.client.post("/api/v1/generate", json=payload, headers=self.headers)