fix: connect Peg to local AI runtime
MetaBloom CI / app (push) Canceled after 0s
MetaBloom CI / api (push) Canceled after 0s

This commit is contained in:
AI Company
2026-07-21 22:06:38 +00:00
parent 02e24cbc92
commit 0c2430ad13
7 changed files with 50 additions and 8 deletions
+11
View File
@@ -88,3 +88,14 @@ def test_coach_fallback_when_provider_is_down(monkeypatch):
response = client.post("/coach/chat", headers=auth(client), json={"message": "Donne-moi une idée simple"})
assert response.status_code == 200
assert response.json()["source"] == "fallback"
def test_ai_health_reports_provider_status(monkeypatch):
async def fake_get(self, url, **kwargs):
request = httpx.Request("GET", url)
return httpx.Response(200, request=request, json={"data": []})
monkeypatch.setattr(httpx.AsyncClient, "get", fake_get)
with TestClient(app) as client:
response = client.get("/health/ai")
assert response.status_code == 200
assert response.json()["reachable"] is True