"""Integration tests for realistic usage scenarios."""
deftest_deepseek_r1_complete_response(self):
"""Test complete DeepSeek-R1 response parsing."""
parser=ReasoningParser("deepseek-r1")
text="I need to solve this step by step. First, I'll analyze the problem. The given equation is x + 2 = 5. To solve for x, I subtract 2 from both sides: x = 5 - 2 = 3.</think>The answer is x = 3."
reasoning,normal=parser.parse_non_stream(text)
self.assertIn("step by step",reasoning)
self.assertIn(
"= 3",reasoning
)# The reasoning contains "x = 5 - 2 = 3" which has "= 3"
self.assertEqual(normal,"The answer is x = 3.")
deftest_qwen3_streaming_scenario(self):
"""Test Qwen3 streaming scenario."""
parser=ReasoningParser("qwen3")
chunks=[
"<think>",
"Let me analyze this problem.",
" I need to consider multiple factors.",
"</think>",
"Based on my analysis, the solution is to use a different approach.",