diff --git a/main.py b/main.py index 66e7884..8bca371 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,7 @@ @app.get("/") async def read_root(): - return {"message": "Hello, FastAPI!"} + return {"message": "Greetings, cosmic voyager! Your journey through the APIverse begins now."} if __name__ == "__main__": import uvicorn diff --git a/requirements.txt b/requirements.txt index f0615cf..7d69a5e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,5 @@ fastapi -uvicorn \ No newline at end of file +uvicorn +pytest +httpx +pandas \ No newline at end of file diff --git a/test_main.py b/test_main.py new file mode 100644 index 0000000..9fe7a07 --- /dev/null +++ b/test_main.py @@ -0,0 +1,9 @@ +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": "Greetings, cosmic voyager! Your journey through the APIverse begins now."} \ No newline at end of file