File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010client = TestClient (app )
1111
1212
13+ < << << << copilot / sub - pr - 7
1314def _mock_db_dependency (rows = None ):
1415 """Return a FastAPI dependency override that yields a mock DB connection."""
1516 if rows is None :
@@ -56,6 +57,17 @@ def test_root_returns_products_from_db() -> None:
5657 assert "Returned 1 products" in body ["meta" ]["message" ]
5758 finally :
5859 app .dependency_overrides .clear ()
60+ == == == =
61+ def test_root_returns_welcome_message () -> None :
62+ """GET / should return a welcome message."""
63+ response = client .get ("/" )
64+ assert response .status_code == 200
65+ json_data = response .json ()
66+ assert "meta" in json_data
67+ assert "data" in json_data
68+ assert "message" in json_data ["meta" ]
69+ assert "NX AI" in json_data ["meta" ]["message" ]
70+ > >> >> >> staging
5971
6072
6173def test_health_returns_ok () -> None :
You can’t perform that action at this time.
0 commit comments