chore(conductor): Archive gemini_cli_headless_20260224 track and update tests
This commit is contained in:
@@ -19,11 +19,12 @@ class TestGeminiCliAdapter(unittest.TestCase):
|
||||
def test_send_starts_subprocess_with_correct_args(self, mock_popen):
|
||||
"""
|
||||
Verify that send(message) correctly starts the subprocess with
|
||||
--output-format stream-json and the provided message.
|
||||
--output-format stream-json and the provided message via stdin.
|
||||
"""
|
||||
# Setup mock process with a minimal valid JSONL termination
|
||||
process_mock = MagicMock()
|
||||
process_mock.stdout = io.StringIO(json.dumps({"type": "result", "usage": {}}) + "\n")
|
||||
process_mock.stdin = MagicMock()
|
||||
process_mock.poll.return_value = 0
|
||||
process_mock.wait.return_value = 0
|
||||
mock_popen.return_value = process_mock
|
||||
@@ -40,10 +41,16 @@ class TestGeminiCliAdapter(unittest.TestCase):
|
||||
self.assertIn("gemini", cmd)
|
||||
self.assertIn("--output-format", cmd)
|
||||
self.assertIn("stream-json", cmd)
|
||||
self.assertIn(message, cmd)
|
||||
# Message should NOT be in cmd now
|
||||
self.assertNotIn(message, cmd)
|
||||
|
||||
# Verify message was written to stdin
|
||||
process_mock.stdin.write.assert_called_once_with(message)
|
||||
process_mock.stdin.close.assert_called_once()
|
||||
|
||||
# Check process configuration
|
||||
self.assertEqual(kwargs.get('stdout'), subprocess.PIPE)
|
||||
self.assertEqual(kwargs.get('stdin'), subprocess.PIPE)
|
||||
self.assertEqual(kwargs.get('text'), True)
|
||||
|
||||
@patch('subprocess.Popen')
|
||||
|
||||
Reference in New Issue
Block a user