feat(tests): Implemented basic tests and github workflow

This commit is contained in:
ribardej
2025-10-21 15:36:49 +02:00
parent be4a3b401a
commit 391e9da0c4
7 changed files with 237 additions and 0 deletions

View 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")