844d8416bd
- Set up the main application structure with App component and routing. - Implemented global state management for UI theme using Zustand. - Created API utilities for fetching system status. - Developed system status page with responsive design and theme toggle. - Added testing setup with Vitest and initial tests for system status page. - Configured TypeScript with appropriate settings for the application. - Integrated Tailwind CSS for styling and responsive design. - Established Vite configuration for development and testing environments.
26 lines
816 B
Python
26 lines
816 B
Python
"""HTTP contract tests for operational system routes."""
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
from zhixing_server.bootstrap.app import create_app
|
|
|
|
|
|
def test_health_endpoint_reports_ok() -> None:
|
|
"""The container probe receives the stable operational contract."""
|
|
response = TestClient(create_app()).get("/healthz")
|
|
|
|
assert response.status_code == 200
|
|
assert response.json() == {"status": "ok"}
|
|
|
|
|
|
def test_system_status_exposes_safe_runtime_metadata() -> None:
|
|
"""The frontend smoke endpoint omits secrets and reports connectivity metadata."""
|
|
response = TestClient(create_app()).get("/api/v1/system/status")
|
|
|
|
assert response.status_code == 200
|
|
assert response.json() == {
|
|
"environment": "development",
|
|
"service": "Zhixing Server",
|
|
"status": "ok",
|
|
}
|