Spaces:
Build error
Build error
| """ | |
| E2E Tests for Health Endpoints | |
| Tests basic server functionality with real HTTP requests. | |
| """ | |
| import pytest | |
| class TestHealthE2E: | |
| """Test health endpoints with real server.""" | |
| def test_health_endpoint(self, api_client): | |
| """Health endpoint returns 200.""" | |
| response = api_client.get("/health") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert data["status"] == "healthy" | |
| def test_root_endpoint(self, api_client): | |
| """Root endpoint returns 200.""" | |
| response = api_client.get("/") | |
| assert response.status_code == 200 | |
| # Root might return JSON or HTML, just check status | |
| def test_docs_endpoint(self, api_client): | |
| """OpenAPI docs are accessible.""" | |
| response = api_client.get("/docs") | |
| # Docs might redirect or return HTML | |
| assert response.status_code in [200, 307] | |
| def test_openapi_json(self, api_client): | |
| """OpenAPI schema is accessible.""" | |
| response = api_client.get("/openapi.json") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert "openapi" in data | |
| assert "paths" in data | |