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:
user 2026-05-14 20:16:59 +00:00
parent db729d4768
commit 2251d84e2a
No known key found for this signature in database

View file

@ -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):