Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(test): correct assertion order in test_case_a_orphaned_tool_call_multiple

Julio Quinteros Prod44d52f1e346
diff --git a/tests/test_litellm/llms/anthropic/test_message_sanitization.py b/tests/test_litellm/llms/anthropic/test_message_sanitization.py
index 489ef527b48..973f2897884 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):
"""