mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-10 08:28:25 +00:00
Merge c8b0c2d0e1 into 10b3deae0d
This commit is contained in:
commit
3187df25da
1 changed files with 20 additions and 0 deletions
|
|
@ -9904,6 +9904,26 @@ def test_is_base64_encoded_2():
|
|||
assert is_base64_encoded(s="Dog") is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"value",
|
||||
[
|
||||
"",
|
||||
"data:text/plain;base64",
|
||||
"data:text/plain;base64,!!!not-base64!!!",
|
||||
],
|
||||
)
|
||||
def test_is_base64_encoded_rejects_malformed_input(value):
|
||||
from litellm.utils import is_base64_encoded
|
||||
|
||||
assert is_base64_encoded(s=value) is False
|
||||
|
||||
|
||||
def test_is_base64_encoded_accepts_text_data_uri():
|
||||
from litellm.utils import is_base64_encoded
|
||||
|
||||
assert is_base64_encoded(s="data:text/plain;base64,aGVsbG8gd29ybGQ=") is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"messages, expected_bool",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue