Skip to content

Commit

Permalink
added a unittest for default excluded urls
Browse files Browse the repository at this point in the history
  • Loading branch information
deepmancer committed Aug 14, 2024
1 parent 5828ef7 commit 3e55501
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,18 @@ async def mock_authenticate(self, token):
response = client.get("/sync-protected", headers=headers)
assert response.status_code == 200
assert response.json() == {"message": "Protected for testuser"}


def test_default_exluded_routes():
expected_excluded_urls = [
"/docs",
"/openapi.json",
"/redoc",
"/swagger-ui",
"/swagger",
"/swagger.json",
"/favicon.ico",
]
assert sorted(JWTAuthenticationMiddleware._default_excluded_urls) == sorted(
expected_excluded_urls
)

0 comments on commit 3e55501

Please sign in to comment.