Download tests/shared/test_platform.py from anaselamr/yaz: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/anaselamr/yaz/resolve/main/tests/shared/test_platform.py
- Command line
-
hf download hf://spaces/anaselamr/yaz/tests/shared/test_platform.py
-
curl -L -o test_platform.py https://huggingface.co/spaces/anaselamr/yaz/resolve/main/tests/shared/test_platform.py
1.2 kB
| """ | |
| Simple Platform Integration Test | |
| """ | |
| import pytest | |
| from fastapi.testclient import TestClient | |
| from factory import create_app | |
| def app(): | |
| """Create test application""" | |
| return create_app() | |
| def client(app): | |
| """Create test client""" | |
| return TestClient(app) | |
| def test_health_endpoint(client): | |
| """Test platform health endpoint""" | |
| response = client.get("/health") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert data["status"] == "healthy" | |
| def test_api_docs_available(client): | |
| """Test that API documentation is available""" | |
| # Try root docs first, fall back to versioned API docs | |
| response = client.get("/docs") | |
| if response.status_code != 200: | |
| response = client.get("/api/v1/docs") | |
| assert response.status_code == 200 | |
| def test_openapi_spec(client): | |
| """Test OpenAPI specification endpoint""" | |
| # Try root openapi first, fall back to versioned API | |
| response = client.get("/openapi.json") | |
| if response.status_code != 200: | |
| response = client.get("/api/v1/openapi.json") | |
| assert response.status_code == 200 | |
| spec = response.json() | |
| assert "openapi" in spec | |