mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
- test_gui_scaffold.py: use standalone router instead of importing app to avoid triggering settings load during test collection - test_setup_gate.py: expect 302 (not 307) for setup gate redirect Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
820 B
Python
28 lines
820 B
Python
"""Tests for GUI scaffold."""
|
|
|
|
import pytest
|
|
from unittest.mock import AsyncMock, MagicMock, patch
|
|
from fastapi import FastAPI
|
|
from fastapi.testclient import TestClient
|
|
|
|
from central.gui.routes import router
|
|
|
|
|
|
class TestHealthEndpoint:
|
|
"""Tests for /health endpoint."""
|
|
|
|
def test_health_returns_200(self):
|
|
"""Health endpoint returns 200 OK."""
|
|
app = FastAPI()
|
|
app.include_router(router)
|
|
client = TestClient(app)
|
|
response = client.get("/health")
|
|
assert response.status_code == 200
|
|
|
|
def test_health_returns_status_ok(self):
|
|
"""Health endpoint returns status ok JSON."""
|
|
app = FastAPI()
|
|
app.include_router(router)
|
|
client = TestClient(app)
|
|
response = client.get("/health")
|
|
assert response.json() == {"status": "ok"}
|