mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-31 06:56:59 +00:00
chore(proxy): drop redundant _is_json_content_type test class
``_is_json_content_type`` is a 3-line wrapper around the shared ``_normalize_media_type`` helper. Positive coverage lives in ``TestGetRequestBody.test_json_with_charset_param_parses_as_json``; negative coverage is covered transitively by ``TestIsFormContentType``'s non-form parametrize matrix (anything that isn't a form type falls through to the JSON branch).
This commit is contained in:
parent
db729d4768
commit
2251d84e2a
1 changed files with 0 additions and 30 deletions
|
|
@ -17,7 +17,6 @@ import litellm
|
|||
from litellm.proxy._types import ProxyException
|
||||
from litellm.proxy.common_utils.http_parsing_utils import (
|
||||
_is_form_content_type,
|
||||
_is_json_content_type,
|
||||
_read_request_body,
|
||||
_safe_get_request_headers,
|
||||
_safe_get_request_parsed_body,
|
||||
|
|
@ -958,35 +957,6 @@ class TestReadRequestBodyFormParseFailure:
|
|||
assert str(exc_info.value.code) == "400"
|
||||
|
||||
|
||||
class TestIsJsonContentType:
|
||||
@pytest.mark.parametrize(
|
||||
"content_type",
|
||||
[
|
||||
"application/json",
|
||||
"application/json; charset=utf-8",
|
||||
"Application/JSON",
|
||||
" application/json ",
|
||||
],
|
||||
)
|
||||
def test_json_types_match(self, content_type):
|
||||
assert _is_json_content_type(content_type) is True
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content_type",
|
||||
[
|
||||
"",
|
||||
"application/x-www-form-urlencoded",
|
||||
"multipart/form-data",
|
||||
"application/jsonl",
|
||||
"application/jsonschema",
|
||||
"text/json",
|
||||
"application/json-patch+json",
|
||||
],
|
||||
)
|
||||
def test_non_json_types_rejected(self, content_type):
|
||||
assert _is_json_content_type(content_type) is False
|
||||
|
||||
|
||||
class TestGetRequestBody:
|
||||
@pytest.mark.asyncio
|
||||
async def test_json_with_charset_param_parses_as_json(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue