@@ -260,7 +260,7 @@ def test_openai_chat_completion_model_parse_and_cost():
260260
261261 mock_create .assert_called_once ()
262262 assert parsed_output .raw_response .choices [0 ].message .content == "This is a test thought."
263- assert parsed_output .action == " get_weather(location=Paris)"
263+ assert parsed_output .action == ' get_weather(location=" Paris")'
264264 assert parsed_output .raw_response .choices [0 ].message .tool_calls [0 ].id == "call_123"
265265 # Check cost tracking (token counts)
266266 assert global_tracker .stats ["input_tokens" ] == 50
@@ -291,7 +291,9 @@ def test_claude_response_model_parse_and_cost():
291291 parsed_output = model (messages )
292292
293293 mock_create .assert_called_once ()
294- fn_calls = [content for content in parsed_output .raw_response .content if content .type == "tool_use" ]
294+ fn_calls = [
295+ content for content in parsed_output .raw_response .content if content .type == "tool_use"
296+ ]
295297 assert "Thinking about the request." in parsed_output .think
296298 assert parsed_output .action == 'search_web(query="latest news")'
297299 assert fn_calls [0 ].id == "tool_abc"
@@ -334,8 +336,10 @@ def test_openai_response_model_parse_and_cost():
334336 parsed_output = model (messages )
335337
336338 mock_create_method .assert_called_once ()
337- fn_calls = [content for content in parsed_output .raw_response .output if content .type == "function_call" ]
338- assert parsed_output .action == "get_current_weather(location=Boston, MA, unit=celsius)"
339+ fn_calls = [
340+ content for content in parsed_output .raw_response .output if content .type == "function_call"
341+ ]
342+ assert parsed_output .action == 'get_current_weather(location="Boston, MA", unit="celsius")'
339343 assert fn_calls [0 ].call_id == "call_abc123"
340344 assert parsed_output .raw_response == mock_api_resp
341345 assert global_tracker .stats ["input_tokens" ] == 70
0 commit comments