From eca502c49cd1bd20ba76b1a52d143def3a5a29a2 Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 19 Dec 2024 17:04:00 +0700 Subject: [PATCH] Do not test authentication on docs endpoints --- tests/api/routes/test_routes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/api/routes/test_routes.py b/tests/api/routes/test_routes.py index b960d6f4..874df251 100644 --- a/tests/api/routes/test_routes.py +++ b/tests/api/routes/test_routes.py @@ -31,6 +31,9 @@ ALLOWED_CONTROLLER_ENDPOINTS = [ ("/", "GET"), ("/debug", "GET"), ("/static/web-ui/{file_path:path}", "GET"), + ("/docs", "GET"), + ("/docs/oauth2-redirect", "GET"), + ("/redoc", "GET"), ("/v3/version", "GET"), ("/v3/version", "POST"), ("/v3/access/users/login", "POST"), @@ -49,6 +52,7 @@ async def test_controller_endpoints_require_authentication(app: FastAPI, unautho if isinstance(route, APIRoute): for method in list(route.methods): if (route.path, method) not in ALLOWED_CONTROLLER_ENDPOINTS: + print(f"Testing {route.path} {method}") response = await getattr(unauthorized_client, method.lower())(route.path) assert response.status_code == status.HTTP_401_UNAUTHORIZED elif isinstance(route, APIWebSocketRoute):