Spaces:
Paused

yaz / tests /shared /test_platform.py
anaselamr's picture
Sprint 34 Progress: Database Indexing & Documentation Complete
ff28ba2
Raw History Blame Contribute Delete
1.2 kB
"""
Simple Platform Integration Test
"""
import pytest
from fastapi.testclient import TestClient
from factory import create_app
@pytest.fixture
def app():
"""Create test application"""
return create_app()
@pytest.fixture
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