Initial FastAPI application

This commit is contained in:
m1000 committed 2026-11-13 02:27:15 +03:00
1 parent a34e861612
commit b118e1d539
6 files changed
+98

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
def test_root():
response = client.get("/")
assert response.status_code == 200
assert response.json()["message"] == "Hello from FastAPI!"
def test_health():
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
def test_hello():
response = client.get("/hello/Artem")
assert response.status_code == 200
assert response.json() == {"message": "Hello, Artem!"}