fix: connect Peg to local AI runtime
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user