Automático: draw-only option; end-to-end test covers biopsies, treatments and deaths

This commit is contained in:
Roberto Treviño
2026-12-03 15:22:15 -06:00
parent 70c88c54dd
commit 05d0e4c278
2 changed files with 9 additions and 6 deletions
+5 -2
View File
@@ -9,6 +9,8 @@ import json
from test_conectar import ok, wait_for
SOURCE = "resultados"
# Studies whose every record the operator's drawing places, the draft must place too.
DRAWN = ("cervical_cytology", "mammography", "cervical_biopsy", "breast_biopsy")
HOURS = 3600 # with a model answering, it reads every document: an hour or more per run
@@ -39,7 +41,8 @@ def test_automatico_drafts_a_sites_pipeline_and_runs_it(api, platform, site):
kinds = [n["kind"] for n in saved["pipeline"]["nodes"]]
assert {"read", "route", "extract", "link", "target"} <= set(kinds)
studies = {n["entity"] for n in saved["pipeline"]["nodes"] if n["kind"] == "target"}
assert {"cervical_cytology", "mammography"} <= studies, studies
# One layout may report several studies: pathology by organ, notes by what they record.
assert set(DRAWN) | {"breast_treatment", "death"} <= studies, studies
# Documents no route claims wait for a reviewer, as with a drawn pipeline.
assert any(n.get("otherwise") for n in saved["pipeline"]["nodes"])
@@ -51,7 +54,7 @@ def test_automatico_drafts_a_sites_pipeline_and_runs_it(api, platform, site):
both = set(mine) & set(theirs)
differ = {k: (mine[k], theirs[k]) for k in both if str(mine[k]) != str(theirs[k])}
assert both and not differ, differ
for study in ("cervical_cytology", "mammography"):
for study in DRAWN:
drawn_records = {r for s, r, _ in theirs if s == study}
assert drawn_records <= {r for s, r, _ in mine if s == study}, study