From 05980899a22e901788c3c806fedf6cd1c272f8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Trevi=C3=B1o?= Date: Thu, 26 Nov 2026 14:25:53 -0600 Subject: [PATCH] TEA gate: every EEG signal kept, alongside the reports --- tests/test_tea.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_tea.py b/tests/test_tea.py index 2e909e9..f3e0363 100644 --- a/tests/test_tea.py +++ b/tests/test_tea.py @@ -137,13 +137,15 @@ def test_tea_from_the_hospital_to_indicators(api, platform, tmp_path): wait_for(api, ok(api.post("/ingest/pipelines/tea/runs", json={}))["run_id"], 1800) q = platform.query - # Silver holds every study of the hospital; each EEG signal is kept once, by its hash. + # Silver holds every study of the hospital; each file (EEG signal, ADOS-2 report) is + # kept once, by its hash. counts = {s: q(f"select count(*) from silver.{s}")[0][0] for s in ("mchat", "ados2", "eeg")} assert counts == {"mchat": 216, "ados2": 113, "eeg": 84} assert q("select count(*) from silver.clinical_note where specialty = 'pediatric_neurology'" )[0][0] == 83 # fmt: skip assert q("select count(*) from silver.eeg where edf is not null")[0][0] == 78 - assert q("select count(*) from bronze.files")[0][0] == 78 + kept = "select count(*) from bronze.files where key in (select edf from silver.eeg)" + assert q(kept)[0][0] == 78 # ADOS-2: the results read from the 50 reports are the current platform's. reference = {(r["ado_fecha"], r["ado_pac_id"]): r for r in