osint-dashboard/tests/test_cache_and_timeline.py
Sirius DevOps d81ea68dec fix: pipeline reliability — WS, summarizer, ingest, health
Stop the live HUD reconnect storm (nginx WS snippet + backoff), copy
intel/nous_client into the summarizer image, and make event ingest
idempotent on URL. GDELT uses the DOC API; NWS no longer sends bbox;
FIRMS is one ON CONFLICT batch; GET /api/aircraft serves last-known.
Health reports freshness without 503ing docker. EONET + CISA KEV added.
2026-08-28 21:49:05 -04:00

21 lines
704 B
Python

"""Timeline bucket_hours + static Cache-Control."""
from __future__ import annotations
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
def test_timeline_uses_bucket_hours():
src = (ROOT / "app/main.py").read_text()
fn = src.split("async def get_timeline")[1].split("async def sentiment_by_source")[0]
assert "bucket_hours" in fn
assert "date_trunc('hour'" not in fn or "bucket" in fn.lower()
# Must not ignore the query param.
assert ":bucket" in fn or "bucket_hours" in fn.split("text(")[1][:800]
def test_static_vendor_cache_control():
src = (ROOT / "app/main.py").read_text()
assert "max-age=31536000" in src or "immutable" in src.lower()