Skip to content

Commit 4e0504f

Browse files
committed
GH-5: Add a sample test case for '/auth' route
1 parent 8f25cd9 commit 4e0504f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_oauth2_middleware.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
})
2323

2424

25-
26-
def test_read_main():
27-
response = client.get("/")
28-
assert response.status_code == 404
25+
@pytest.mark.anyio
26+
async def test_auth_redirect():
27+
async with AsyncClient(app=app, base_url="http://test") as client:
28+
response = await client.get("/oauth2/github/auth")
29+
assert response.status_code == 303 # Redirect

0 commit comments

Comments
 (0)