central/tests/test_gui_scaffold.py
Matt Johnson b1ba2d1863 fix(tests): update tests for lazy app loading and 302 redirect
- 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>
2026-05-17 06:14:25 +00:00

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"}