We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e57f7fb commit 51ac549Copy full SHA for 51ac549
tests/test_oauth2_middleware.py
@@ -0,0 +1,19 @@
1
+from fastapi import APIRouter
2
+from fastapi import FastAPI
3
+from fastapi.testclient import TestClient
4
+
5
+from fastapi_oauth2.middleware import OAuth2Middleware
6
+from fastapi_oauth2.router import router as oauth2_router
7
8
+app = FastAPI()
9
+router = APIRouter()
10
11
+app.include_router(oauth2_router)
12
+app.add_middleware(OAuth2Middleware, config={})
13
14
+client = TestClient(app)
15
16
17
+def test_read_main():
18
+ response = client.get("/")
19
+ assert response.status_code == 404
0 commit comments