refactor(proxy): drop redundant docstrings from upload allowlist helpers and tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yassin 2026-09-14 19:00:49 +00:00
parent 82ef6ea6ab
commit ce0301c23f
3 changed files with 0 additions and 7 deletions

View file

@ -32,10 +32,6 @@ def coerce_optional_int_setting(raw: object) -> int | None:
def coerce_optional_str_list_setting(raw: object) -> tuple[str, ...] | None:
"""A general_settings value declared as an optional list of strings, e.g. allowed_file_extensions.
None (unset) and [] (set to nothing) are different answers for an allowlist, so both survive.
"""
if raw is None:
return None
if not isinstance(raw, list) or not all(isinstance(item, str) for item in raw):
@ -104,7 +100,6 @@ def check_allowed_extension(
filename: str | None,
allowed_extensions: tuple[str, ...] | None,
) -> UploadedFileExtensionNotAllowed | None:
"""None means the allowlist is not configured; an empty tuple means nothing is allowed."""
if allowed_extensions is None:
return None
extension: Final = _normalized_extension(filename)

View file

@ -4776,7 +4776,6 @@ def test_create_file_empty_allowlist_rejects_every_upload(monkeypatch, llm_route
def test_create_file_allowlist_runs_before_blocklist(monkeypatch, llm_router: Router):
"""An extension in both lists is refused by the allowlist message, and the blocklist still holds on its own."""
import litellm.proxy.proxy_server as ps
forwarded_calls = _setup_batch_upload_endpoint(monkeypatch, llm_router)

View file

@ -104,7 +104,6 @@ def test_allowed_extension_match_is_case_insensitive_for_configured_value():
@pytest.mark.parametrize("filename", ["README", "", None, "../../"])
def test_no_extension_rejected_when_allowlist_set(filename):
"""The allowlist grants by extension, so a name that yields none has nothing to be granted for."""
assert check_allowed_extension(filename, (".jsonl",)) == UploadedFileExtensionNotAllowed(extension="")