CI / ruff · pytest (pull_request) Successful in 22s
Freeze interfaces between lanes A (bot), B (backend), C (dashboard) so three developers work in parallel without touching each other's files: dialog Event/Reply + engine registry with echo stub, integration protocols with in-memory defaults, MonitoringService with noop stub, /api/v1 schemas with fixture-backed routes, frozen main.py wiring, config/modules.yaml + due_scales(), DAR-5, tzdata, Andrey trajectory, lanes in WORKFLOW, ADR-010. Refs #34 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
937 B
Python
22 lines
937 B
Python
from fastapi.testclient import TestClient
|
|
|
|
from app.dialog.contracts import Event, get_engine
|
|
from app.main import app
|
|
from app.services.contracts import get_monitoring
|
|
|
|
|
|
async def test_stubs_are_usable() -> None:
|
|
replies = await get_engine().handle("tok", Event(type="text", text="привет"))
|
|
assert replies and replies[0].text
|
|
assert await get_monitoring().after_data_change("tok") == []
|
|
|
|
|
|
def test_api_fixture_routes() -> None:
|
|
with TestClient(app) as c:
|
|
patients = c.get("/api/v1/doctors/doc-smirnova/patients").json()
|
|
assert patients[0]["status_color"] == "red"
|
|
card = c.get("/api/v1/patients/tok-andrey", params={"doctor_id": "doc-smirnova"}).json()
|
|
assert card["safety_plan"] and card["series"]
|
|
assert c.post("/api/v1/dialog/tok-andrey/events", json={"type": "text", "text": "ok"}).status_code == 200
|
|
assert c.get("/api/v1/demo/clock").json()["virtual"] is True
|