From 9b631928adeaac9639809fb66c34dc330c1b0cef Mon Sep 17 00:00:00 2001 From: alberto Date: Tue, 1 Dec 2026 17:48:03 -0600 Subject: [PATCH] The hospital test follows the Gobernanza buttons: analyze, train, promote, score, then checks the risk analyses --- tests/test_webapp.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_webapp.py b/tests/test_webapp.py index 89b905b..3426224 100644 --- a/tests/test_webapp.py +++ b/tests/test_webapp.py @@ -59,7 +59,7 @@ def _sensor_run(api: httpx.Client, seconds: int = 300) -> str: def _train_tea(api: httpx.Client) -> None: - _wait(api, _ok(api.post("/tea/eegs/analyze", json={}))["run_id"]) + _wait(api, _ok(api.post("/models/tea/analyze", json={}))["run_id"]) for names in (list(MODELS), [ASSOCIATION]): training = _ok( api.post( @@ -88,7 +88,13 @@ def _train_tea(api: httpx.Client) -> None: v["version"] == version and v["status"] == "champion" for v in _ok(api.get(versions)) ), name - _wait(api, _ok(api.post("/tea/eegs/analyze", json={}))["run_id"]) + _wait(api, _ok(api.post("/models/tea/score"))["run_id"]) + risks = _ok( + api.get( + "/tea/fhir/Patient", params={"_revinclude": "RiskAssessment:subject", "_count": 500} + ) + ) + assert any(e["resource"]["resourceType"] == "RiskAssessment" for e in risks["entry"]) @contextmanager