From 54ef8a1e199af9c4c9799bd03e82fb5ca79dc7b0 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 7 Mar 2025 16:52:51 -0800 Subject: [PATCH] fix: Update test mocking to match send_completion method signature --- tests/basic/test_reasoning.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/basic/test_reasoning.py b/tests/basic/test_reasoning.py index a50a8e999..5ded83f63 100644 --- a/tests/basic/test_reasoning.py +++ b/tests/basic/test_reasoning.py @@ -29,22 +29,12 @@ class TestReasoning(unittest.TestCase): mock_completion = MockCompletion(main_content, reasoning_content) - # Mock the model's send_completion method - with patch.object(model, "send_completion", return_value=mock_completion): + # Mock the model's send_completion method to return the expected tuple format + with patch.object(model, "send_completion", return_value=(None, mock_completion)): # Call send with a simple message messages = [{"role": "user", "content": "test prompt"}] list(coder.send(messages)) - # Format the response as it would happen in the normal flow - #coder.partial_response_content = mock_completion.content - #coder.partial_response_reasoning_content = mock_completion.reasoning_content - #output = coder.get_multi_response_content_in_progress(final=True) - - # Manually call ai_output to simulate the normal flow - #coder.io.ai_output(output) - - print(coder.partial_response_content) - # Now verify ai_output was called with the right content io.ai_output.assert_called_once() output = io.ai_output.call_args[0][0]