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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user