feat(geofence): hear quakes, WFIGS incidents, and news pins
New hits carry a frozen evidence pack. adsb/ais/firms payloads stay unchanged, and cameras are never passed to record_and_notify.
This commit is contained in:
parent
d04ddc9afa
commit
d878655617
7 changed files with 990 additions and 26 deletions
|
|
@ -67,7 +67,43 @@ def test_geofence_alerts_passes_filters(monkeypatch):
|
|||
assert seen["until"] is not None
|
||||
|
||||
|
||||
def test_geofence_alerts_rejects_bad_source_kind():
|
||||
def test_geofence_at_accepts_ts_alias(monkeypatch):
|
||||
seen = {}
|
||||
|
||||
async def snap(gid: str, ts):
|
||||
seen["gid"] = gid
|
||||
seen["ts"] = ts
|
||||
return {
|
||||
"geofence_id": gid,
|
||||
"timestamp": ts.isoformat(),
|
||||
"aircraft": [],
|
||||
"vessels": [],
|
||||
"fires": [],
|
||||
}
|
||||
|
||||
monkeypatch.setattr("geofence.snapshot_at", snap)
|
||||
resp = asyncio.run(_req(
|
||||
"GET", f"/api/geofences/{FENCE_ID}/at",
|
||||
params={"ts": "2026-08-28T12:04:00Z"},
|
||||
))
|
||||
assert resp.status_code == 200
|
||||
assert seen["gid"] == FENCE_ID
|
||||
assert seen["ts"].year == 2026
|
||||
|
||||
|
||||
def test_geofence_alerts_accepts_new_kinds(monkeypatch):
|
||||
seen = {}
|
||||
|
||||
async def fake_list(**kwargs):
|
||||
seen.update(kwargs)
|
||||
return []
|
||||
|
||||
monkeypatch.setattr("geofence.list_alerts", fake_list)
|
||||
resp = asyncio.run(_req(
|
||||
"GET", "/api/geofence-alerts", params={"source_kind": "earthquake"},
|
||||
))
|
||||
assert resp.status_code == 200
|
||||
assert seen["source_kind"] == "earthquake"
|
||||
resp = asyncio.run(_req(
|
||||
"GET", "/api/geofence-alerts", params={"source_kind": "camera"},
|
||||
))
|
||||
|
|
|
|||
Loading…
Reference in a new issue