From fab9196beae66b39811ae0c348448f784c2c370e Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 16:28:20 -0400 Subject: [PATCH] test(ai_cache_tracking): migrate to send_result() (Phase 2.2) The test calls ai_client.send() but does not check the return value - it only verifies the side effect on gemini cache stats. Migrating to send_result() and asserting result.ok is enough. Changes: - Rename ai_client.send(...) to ai_client.send_result(...) - Add assert result.ok (the return value is unused) - Add "from src.result_types import Result" import 2 tests pass. --- tests/test_ai_cache_tracking.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_ai_cache_tracking.py b/tests/test_ai_cache_tracking.py index c9d508fa..3e7171a3 100644 --- a/tests/test_ai_cache_tracking.py +++ b/tests/test_ai_cache_tracking.py @@ -1,6 +1,7 @@ import unittest from unittest.mock import patch, MagicMock from src import ai_client +from src.result_types import Result import time def test_gemini_cache_tracking() -> None: @@ -44,11 +45,12 @@ def test_gemini_cache_tracking() -> None: mock_client.caches.list.return_value = [MagicMock(size_bytes=5000)] # Act - ai_client.send( + result = ai_client.send_result( md_content="Some long context that triggers caching", user_message="Hello", file_items=file_items ) + assert result.ok # Assert stats = ai_client.get_gemini_cache_stats()