diff --git a/backend/main.py b/backend/main.py new file mode 100644 index 0000000..8cdfa04 --- /dev/null +++ b/backend/main.py @@ -0,0 +1,8 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +def read_root(): + return {"message": "Hello, World!"} diff --git a/backend/tests/__init__.py b/backend/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/tests/test_main.py b/backend/tests/test_main.py new file mode 100644 index 0000000..c3e96d8 --- /dev/null +++ b/backend/tests/test_main.py @@ -0,0 +1,11 @@ +from fastapi.testclient import TestClient + +from main import app + +client = TestClient(app) + + +def test_read_root(): + response = client.get("/") + assert response.status_code == 200 + assert response.json() == {"message": "Hello, World!"}