mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
feat(tests): Implemented basic tests and github workflow
This commit is contained in:
18
7project/backend/tests/test_integration_app.py
Normal file
18
7project/backend/tests/test_integration_app.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user