decomposer: scaffold crucible-agent-build-fastapi-endpoint
Some checks are pending
ci / quality (push) Has started running
ci / container (push) Has started running

This commit is contained in:
2026-08-09 16:09:29 +00:00
parent 0c3d9cc535
commit 2516a21b98

View File

@@ -1,29 +1 @@
from collections.abc import AsyncIterator # Env var setup that must run before app.config is imported.
import pytest
from fastapi.testclient import TestClient
from app.config import Settings
from app.main import create_app
from app.models import CurrentStatus, MonitorState, utc_now
class FakeChecker:
async def check(self, monitor_id: str, target_url: str) -> CurrentStatus:
return CurrentStatus(
state=MonitorState.UP,
checked_at=utc_now(),
latency_ms=3.5,
http_status=204,
)
@pytest.fixture
def anyio_backend() -> str:
return "asyncio"
@pytest.fixture
def client() -> AsyncIterator[TestClient]:
with TestClient(create_app(Settings(), checker=FakeChecker())) as test_client: # type: ignore[arg-type]
yield test_client