def test_health_returns_200(client): c, _ = client resp = c.get("/health") assert resp.status_code == 200 def test_health_endpoint_body(client): """Health endpoint returns a body with 'status'.""" c, _ = client resp = c.get("/health") assert resp.status_code == 200 # Body may be JSON or plain text try: data = resp.json() assert "status" in data except Exception: pass # Non-JSON health check body is also acceptable def test_health_db_not_required(client): """Health check does not depend on DB availability.""" c, mock_db = client mock_db.query.side_effect = Exception("DB down") resp = c.get("/health") # Health should still return 200 even if DB throws assert resp.status_code == 200