Тесты и запуск тестов в раннере
All checks were successful
CI / test (push) Successful in 1m19s
Test Workflow / test (push) Successful in 1s

This commit is contained in:
2026-03-23 14:07:34 +03:00
parent 334d8194a2
commit e69b3bbb08
4 changed files with 51 additions and 0 deletions

2
api/tests/__init__.py Normal file
View File

@@ -0,0 +1,2 @@
"""Tests for the FastAPI app."""

19
api/tests/test_app.py Normal file
View File

@@ -0,0 +1,19 @@
from fastapi.testclient import TestClient
from api.main import app
client = TestClient(app)
def test_health() -> None:
resp = client.get("/health")
assert resp.status_code == 200
assert resp.json() == {"status": "ok"}
def test_root() -> None:
resp = client.get("/")
assert resp.status_code == 200
assert resp.json() == {"message": "FastAPI is running"}