No domain logic in the app: labels checked by labeling (validate.check, ids.assign), client message and action by labeling/client.py, events by categories.window, references by data.is_reference; manual/ no longer written

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 09:32:20 +01:00
1 parent 7332306b79
commit a733575d65
7 files changed
+63 -109

No files matched your search

+8 -4
View File
@@ -75,8 +75,6 @@ def check_station():
ev = station.detectors("LENZSPITZE", "2026-10-26", "2026-10-27") # the detectors of the journal, ~10 s
assert ev and {"start", "end", "family", "description", "sensors"} <= set(ev[0]), ev[:1]
assert all(e["message"] and e["action"] and set(e["targets"] + e["references"]) == set(e["sensors"]) for e in ev), ev[:1]
assert station.message("A moved; nothing to do. The jump of 2 targets in this period has the same cause.") \
== "A moved. The jump of 2 targets in this period has the same cause."
assert all(e["end"] >= "2026-10-26T00:00Z" and e["start"] < "2026-10-27T00:00Z" for e in ev), [(e["start"], e["end"]) for e in ev]
refuses(station.pump, {"stations": ["A;rm"]}) # the pumping (extraction/pumping.py, checked there): a refusal
assert not any("SIM_CCID" in t or t.startswith("System: ip") for t in titles)
@@ -86,14 +84,20 @@ def check_station():
e = station.add({"station": "NIEDERHORN", "folder": "auto", "start": "2026-09-25T01:00Z",
"end": "2026-09-25T02:00Z", "family": "Visibility", "description": "fog"})
assert e["id"] == "NIEDERHORN-1" and next(iter(e)) == "id", e
refuses(station.update, {"station": "NIEDERHORN", "folder": "auto", "before": e, # labeling/scripts/validate.py
"start": e["start"], "end": e["end"], "family": "", "description": "rain"})
e2 = station.update({"station": "NIEDERHORN", "folder": "auto", "before": e,
"start": e["start"], "end": e["end"], "family": "", "description": "rain"})
assert e2 == {"id": "NIEDERHORN-1", "start": e["start"], "end": e["end"], "description": "rain"}, e2
"start": e["start"], "end": e["end"], "family": "Obstruction", "description": "rain"})
assert e2 == {"id": "NIEDERHORN-1", "start": e["start"], "end": e["end"], "family": "Obstruction", "description": "rain"}, e2
assert station.read("NIEDERHORN", "auto") == [e2]
assert "no longer in the file" in refuses(station.delete, {"station": "NIEDERHORN", "folder": "auto", "before": e})
station.delete({"station": "NIEDERHORN", "folder": "auto", "before": e2})
assert station.read("NIEDERHORN", "auto") == []
refuses(station.add, {"station": "NIEDERHORN", "folder": "../x", "start": "a", "end": "b", "description": "x"})
refuses(station.add, {"station": "NIEDERHORN", "folder": "manual", "start": "2026-09-25T01:00Z", # the expert's
"end": "2026-09-25T02:00Z", "family": "Visibility", "description": "fog"})
refuses(station.add, {"station": "NIEDERHORN", "start": "2026-09-25T01:00Z", "end": "2026-09-25T02:00Z",
"family": "Visibility", "description": "a shift of 3 px"})
refuses(station.add, {"station": "NIEDERHORN", "start": "2026-09-25T02:00Z", "end": "2026-09-25T01:00Z", "description": "x"})
finally:
shutil.rmtree(station.LABELS)