From 37c7b81c956e246e156b6a6390792a5761292165 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 7 Mar 2025 17:20:03 -0800 Subject: [PATCH] test: Ensure partial_response_content contains only main content --- tests/basic/test_reasoning.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/basic/test_reasoning.py b/tests/basic/test_reasoning.py index c04fb4668..217d88e66 100644 --- a/tests/basic/test_reasoning.py +++ b/tests/basic/test_reasoning.py @@ -57,6 +57,9 @@ class TestReasoning(unittest.TestCase): # Output should include both reasoning and main content self.assertIn(reasoning_content, output) self.assertIn(main_content, output) + + # Verify that partial_response_content only contains the main content + self.assertEqual(coder.partial_response_content.strip(), main_content.strip()) # Ensure proper order: reasoning first, then main content reasoning_pos = output.find(reasoning_content) @@ -163,6 +166,13 @@ class TestReasoning(unittest.TestCase): self.assertLess( reasoning_pos, main_pos, "Reasoning content should appear before main content" ) + + # Verify that partial_response_content only contains the main content + expected_content = "Final answer after reasoning" + self.assertEqual(coder.partial_response_content.strip(), expected_content) + + # Verify that partial_response_content only contains the main content + self.assertEqual(coder.partial_response_content.strip(), "Final answer after reasoning") def test_send_with_think_tags(self): """Test that tags are properly processed and formatted.""" @@ -228,6 +238,9 @@ class TestReasoning(unittest.TestCase): self.assertLess( reasoning_pos, main_pos, "Reasoning content should appear before main content" ) + + # Verify that partial_response_content only contains the main content + self.assertEqual(coder.partial_response_content.strip(), main_content.strip()) def test_send_with_think_tags_stream(self): """Test that streaming with tags is properly processed and formatted."""