From 32ae491b6ddbb35da44cdd9324e490b5e5764f69 Mon Sep 17 00:00:00 2001 From: Shalmankursheeth Date: Fri, 28 Aug 2026 10:26:59 +0000 Subject: [PATCH] test(utils): trim redundant comments per review feedback --- tests/test_litellm/test_utils.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index 409cc2ac4ce..12e10a2201a 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -1602,7 +1602,6 @@ def test_vertex_params_not_stripped_for_vertex_family( class TestIsBase64Encoded: def test_valid_base64_data_uri_returns_true(self): - # "aGVsbG8gd29ybGQ=" is the base64 encoding of "hello world" assert ( litellm.utils.is_base64_encoded( "data:text/plain;base64,aGVsbG8gd29ybGQ=" @@ -1611,29 +1610,26 @@ class TestIsBase64Encoded: ) def test_plain_string_without_data_prefix_returns_false(self): - # Guards against false positives on ordinary strings, e.g. "Dog" assert litellm.utils.is_base64_encoded("Dog") is False def test_empty_string_returns_false(self): assert litellm.utils.is_base64_encoded("") is False def test_data_prefix_without_comma_returns_false(self): - # No comma means the split(",")[1] access fails internally, - # which is caught by the except Exception clause assert litellm.utils.is_base64_encoded("data:text/plain;base64") is False def test_data_prefix_with_invalid_base64_content_returns_false(self): - # "!!!not-base64!!!" is not valid base64, decode should fail assert ( litellm.utils.is_base64_encoded("data:text/plain;base64,!!!not-base64!!!") is False ) def test_data_prefix_with_empty_payload_returns_true(self): - # Empty string after the comma decodes to empty bytes, which - # trivially round-trips back to an empty string, so this is True + # NOTE: this currently returns True because an empty string trivially + # round-trips through base64 decode/encode. Callers that use this + # result to route empty payloads into image/media fields should be + # aware this is a false positive — see PR #38638 discussion. assert litellm.utils.is_base64_encoded("data:text/plain;base64,") is True - from litellm.utils import supports_function_calling