mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 23:20:56 +01:00
19 lines
507 B
Python
19 lines
507 B
Python
from fastapi import status
|
|
import pytest
|
|
|
|
|
|
def test_root_ok(client):
|
|
resp = client.get("/")
|
|
assert resp.status_code == status.HTTP_200_OK
|
|
assert resp.json() == {"status": "ok"}
|
|
|
|
|
|
def test_authenticated_route_requires_auth(client):
|
|
resp = client.get("/authenticated-route")
|
|
assert resp.status_code in (status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN)
|
|
|
|
|
|
def test_sentry_debug_raises_exception(client):
|
|
with pytest.raises(ZeroDivisionError):
|
|
client.get("/sentry-debug")
|