diff --git a/api/tests/test_endpoints.py b/api/tests/test_endpoints.py index b7db5ee..b3f6d70 100644 --- a/api/tests/test_endpoints.py +++ b/api/tests/test_endpoints.py @@ -1,8 +1,10 @@ import json from pathlib import Path +import pytest from fastapi.testclient import TestClient +import app.narrate as narrate from app.main import app client = TestClient(app) @@ -14,6 +16,15 @@ ROLE_ENDPOINTS = [ ] +@pytest.fixture(autouse=True) +def _stub_narrate_model_call(monkeypatch): + # /dm/narrate is wired to a real Ollama call (Task 7). These tests exercise + # canon-log validation across ALL role endpoints, not model behavior, so + # stub the model boundary — keeps the default suite hermetic (no network). + monkeypatch.setattr(narrate.ollama_client, "chat", lambda *a, **k: "stubbed prose") + monkeypatch.setattr(narrate.call_log, "record", lambda **kw: None) + + def test_health_ok(): assert client.get("/health").json() == {"status": "ok"}