feat: initialize managed portal

This commit is contained in:
Yoilun
2026-04-27 10:04:36 +08:00
commit d4e351df71
145 changed files with 13425 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import json
from app.modules.notifier import append_json_event
def test_append_json_event_writes_jsonl(tmp_path):
output = tmp_path / "logs" / "events.jsonl"
append_json_event(output, {"event": "long_stay_alert", "count": 5})
append_json_event(output, {"event": "half_hour_report", "count": 3})
lines = output.read_text(encoding="utf-8").splitlines()
assert json.loads(lines[0]) == {"event": "long_stay_alert", "count": 5}
assert json.loads(lines[1]) == {"event": "half_hour_report", "count": 3}