test(gemini_cli_parity_regression): migrate to send_result() (Phase 2.4)
The test_send_invokes_adapter_send test calls ai_client.send() and asserts the return value. Migrating to send_result() with assert res.ok and res.data == "Hello from mock adapter". Changes: - Rename ai_client.send(...) to ai_client.send_result(...) - Add assert res.ok before accessing res.data - Add "from src.result_types import Result" import 1 test passes.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from unittest.mock import patch, MagicMock
|
||||
from src.result_types import Result
|
||||
|
||||
def test_send_invokes_adapter_send() -> None:
|
||||
import src.ai_client as ai_client
|
||||
@@ -9,5 +10,6 @@ def test_send_invokes_adapter_send() -> None:
|
||||
mock_process.returncode = 0
|
||||
mock_popen.return_value = mock_process
|
||||
ai_client.set_provider("gemini_cli", "gemini-2.0-flash")
|
||||
res = ai_client.send("context", "msg")
|
||||
assert res == "Hello from mock adapter"
|
||||
res = ai_client.send_result("context", "msg")
|
||||
assert res.ok
|
||||
assert res.data == "Hello from mock adapter"
|
||||
|
||||
Reference in New Issue
Block a user