2026-05-17 04:32:39 +00:00
|
|
|
"""Tests for GUI scaffold."""
|
|
|
|
|
|
2026-05-17 06:14:25 +00:00
|
|
|
import pytest
|
|
|
|
|
from unittest.mock import AsyncMock, MagicMock, patch
|
|
|
|
|
from fastapi import FastAPI
|
2026-05-17 04:32:39 +00:00
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
|
|
2026-05-17 06:14:25 +00:00
|
|
|
from central.gui.routes import router
|
2026-05-17 04:32:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestHealthEndpoint:
|
|
|
|
|
"""Tests for /health endpoint."""
|
|
|
|
|
|
|
|
|
|
def test_health_returns_200(self):
|
|
|
|
|
"""Health endpoint returns 200 OK."""
|
2026-05-17 06:14:25 +00:00
|
|
|
app = FastAPI()
|
|
|
|
|
app.include_router(router)
|
|
|
|
|
client = TestClient(app)
|
2026-05-17 04:32:39 +00:00
|
|
|
response = client.get("/health")
|
|
|
|
|
assert response.status_code == 200
|
|
|
|
|
|
|
|
|
|
def test_health_returns_status_ok(self):
|
|
|
|
|
"""Health endpoint returns status ok JSON."""
|
2026-05-17 06:14:25 +00:00
|
|
|
app = FastAPI()
|
|
|
|
|
app.include_router(router)
|
|
|
|
|
client = TestClient(app)
|
2026-05-17 04:32:39 +00:00
|
|
|
response = client.get("/health")
|
|
|
|
|
assert response.json() == {"status": "ok"}
|