From bf96f8b301d315f1a17c0cd39081d258899ef600 Mon Sep 17 00:00:00 2001 From: dongli Date: Sun, 11 May 2025 19:16:00 -0700 Subject: [PATCH] Add template fastapi app, test, README.md, this can be used for future extension --- apps/devops/tests/routes/__init__.py | 0 apps/devops/tests/routes/test_hello_world.py | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 apps/devops/tests/routes/__init__.py create mode 100644 apps/devops/tests/routes/test_hello_world.py diff --git a/apps/devops/tests/routes/__init__.py b/apps/devops/tests/routes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/devops/tests/routes/test_hello_world.py b/apps/devops/tests/routes/test_hello_world.py new file mode 100644 index 0000000..285d174 --- /dev/null +++ b/apps/devops/tests/routes/test_hello_world.py @@ -0,0 +1,9 @@ +from fastapi.testclient import TestClient +from app.main import app # Adjust this import if your app is in a different location + +client = TestClient(app) + +def test_hello_world(): + response = client.get("/api/hello_world/") + assert response.status_code == 200 + assert response.json() == {"message": "Hello, World!"} # Update if your endpoint returns different data \ No newline at end of file