test(gemini_cli_integration): migrate 2 sites to send_result() (Phase 2.10)
Changes: - Rename ai_client.send(...) to ai_client.send_result(...) (2 sites) - Add assert result.ok (1 site; the second test only checks result is not None) - Add "from src.result_types import Result" import 2 tests pass.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from unittest.mock import MagicMock
|
||||
from src import ai_client
|
||||
from src.result_types import Result
|
||||
|
||||
|
||||
def test_gemini_cli_full_integration() -> None:
|
||||
@@ -12,8 +13,9 @@ def test_gemini_cli_full_integration() -> None:
|
||||
}
|
||||
mock_adapter.last_usage = {"total_tokens": 10}
|
||||
ai_client._gemini_cli_adapter = mock_adapter
|
||||
result = ai_client.send("context", "integrated test")
|
||||
assert "Final integrated answer" in result
|
||||
result = ai_client.send_result("context", "integrated test")
|
||||
assert result.ok
|
||||
assert "Final integrated answer" in result.data
|
||||
|
||||
|
||||
def test_gemini_cli_rejection_and_history() -> None:
|
||||
@@ -26,5 +28,5 @@ def test_gemini_cli_rejection_and_history() -> None:
|
||||
}
|
||||
mock_adapter.last_usage = {}
|
||||
ai_client._gemini_cli_adapter = mock_adapter
|
||||
result = ai_client.send("ctx", "msg", pre_tool_callback=lambda *a, **kw: None)
|
||||
result = ai_client.send_result("ctx", "msg", pre_tool_callback=lambda *a, **kw: None)
|
||||
assert result is not None
|
||||
|
||||
Reference in New Issue
Block a user