mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
test(proxy): cover non-string access log paths
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
2268bbaf5e
commit
66ce1eea97
1 changed files with 14 additions and 0 deletions
|
|
@ -1228,6 +1228,20 @@ def test_access_log_path_filter_keeps_a_record_without_positional_args():
|
|||
assert AccessLogPathFilter(frozenset({"/health/liveliness"})).filter(record) is True
|
||||
|
||||
|
||||
def test_access_log_path_filter_keeps_a_record_with_a_non_string_path():
|
||||
record = logging.LogRecord(
|
||||
name="uvicorn.access",
|
||||
level=logging.INFO,
|
||||
pathname="",
|
||||
lineno=0,
|
||||
msg="%s - %s %s",
|
||||
args=("127.0.0.1:1", "GET", 42),
|
||||
exc_info=None,
|
||||
)
|
||||
|
||||
assert AccessLogPathFilter(frozenset({"/health/liveliness"})).filter(record) is True
|
||||
|
||||
|
||||
def test_uvicorn_access_logger_drops_a_listed_path_end_to_end(monkeypatch):
|
||||
monkeypatch.setenv("LITELLM_DISABLE_ACCESS_LOG_PATHS", "/health/liveliness")
|
||||
access_log_filter = AccessLogPathFilter(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue