From 900ef454c83097452884000ea3185520a07b4794 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Fri, 1 May 2026 15:35:30 +0530 Subject: [PATCH] test: fix Bedrock PDF tool-result bytes assertion in factory test The test supplies a minimal PDF base64 payload but expected the wrong constant (base64 for "test"). Assert against the same pdf_b64 value and drop the unused import. Made-with: Cursor --- .../test_litellm_core_utils_prompt_templates_factory.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.py b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.py index 33bdf169ccd..27a3ddb553d 100644 --- a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.py +++ b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_factory.py @@ -2487,10 +2487,6 @@ def test_convert_to_anthropic_tool_result_openai_file_pdf_becomes_document(): inside the tool_result content. Reuses anthropic_process_openai_file_message, which already handles this for user messages. """ - from litellm.litellm_core_utils.prompt_templates.factory import ( - convert_to_anthropic_tool_result, - ) - pdf_b64 = "JVBERi0xLjQKJeLjz9MK" message = { "tool_call_id": "toolu_pdf_1", @@ -2513,7 +2509,7 @@ def test_convert_to_anthropic_tool_result_openai_file_pdf_becomes_document(): assert len(tool_result["content"]) == 1 assert "document" in tool_result["content"][0] assert tool_result["content"][0]["document"]["format"] == "pdf" - assert tool_result["content"][0]["document"]["source"]["bytes"] == "dGVzdA==" + assert tool_result["content"][0]["document"]["source"]["bytes"] == pdf_b64 def test_bedrock_converse_messages_pt_document_various_formats():