File size: 1,197 Bytes
6a8aa67 ff28ba2 6a8aa67 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | """
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
|