From d44d52f1e346b46c6c66a033f35ee76e9ee1c62b Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Wed, 18 Feb 2026 08:25:33 -0300 Subject: [PATCH] fix(test): correct assertion order in test_case_a_orphaned_tool_call_multiple The implementation correctly preserves tool_call order: existing results first (call_1), then dummy results for missing ones (call_2). The test was asserting the reverse order with incorrect comments. Fix the assertions to match the actual correct behavior. Co-Authored-By: Claude Sonnet 4.6 --- .../test_litellm/llms/anthropic/test_message_sanitization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/llms/anthropic/test_message_sanitization.py b/tests/test_litellm/llms/anthropic/test_message_sanitization.py index 489ef527b4..973f289788 100644 --- a/tests/test_litellm/llms/anthropic/test_message_sanitization.py +++ b/tests/test_litellm/llms/anthropic/test_message_sanitization.py @@ -116,8 +116,8 @@ class TestMessageSanitization: assert len(sanitized) == 4 assert sanitized[0]["role"] == "user" assert sanitized[1]["role"] == "assistant" - assert sanitized[2]["tool_call_id"] == "call_2" # Dummy added first - assert sanitized[3]["tool_call_id"] == "call_1" # Original tool result + assert sanitized[2]["tool_call_id"] == "call_1" # Original tool result (first in tool_calls) + assert sanitized[3]["tool_call_id"] == "call_2" # Dummy added for missing call_2 def test_case_b_orphaned_tool_result(self): """