fix(vision): wrap the health-filter test lines (ruff E501 broke the image build)
This commit is contained in:
@@ -60,8 +60,13 @@ def test_health_access_log_lines_are_dropped() -> None:
|
|||||||
access = logging.getLogger("uvicorn.access")
|
access = logging.getLogger("uvicorn.access")
|
||||||
# uvicorn's access record: '%s - "%s %s HTTP/%s" %d' with (client, method, path, version, status)
|
# uvicorn's access record: '%s - "%s %s HTTP/%s" %d' with (client, method, path, version, status)
|
||||||
fmt = '%s - "%s %s HTTP/%s" %d'
|
fmt = '%s - "%s %s HTTP/%s" %d'
|
||||||
health = access.makeRecord("uvicorn.access", logging.INFO, __file__, 0, fmt, ("127.0.0.1:1", "GET", "/health", "1.1", 200), None)
|
|
||||||
analyze = access.makeRecord("uvicorn.access", logging.INFO, __file__, 0, fmt, ("127.0.0.1:1", "POST", "/analyze", "1.1", 200), None)
|
def record(method: str, path: str) -> logging.LogRecord:
|
||||||
|
args = ("127.0.0.1:1", method, path, "1.1", 200)
|
||||||
|
return access.makeRecord("uvicorn.access", logging.INFO, __file__, 0, fmt, args, None)
|
||||||
|
|
||||||
|
health = record("GET", "/health")
|
||||||
|
analyze = record("POST", "/analyze")
|
||||||
assert flt.filter(health) is False
|
assert flt.filter(health) is False
|
||||||
assert flt.filter(analyze) is True
|
assert flt.filter(analyze) is True
|
||||||
# The filter is installed on the live logger at import.
|
# The filter is installed on the live logger at import.
|
||||||
|
|||||||
Reference in New Issue
Block a user