bmc_hub/tests/test_drift_operations_ui.py

25 lines
1016 B
Python
Raw Permalink Normal View History

from pathlib import Path
def test_drift_ui_uses_authoritative_summary_and_structured_ignore_flow():
source = Path("app/modules/drift/templates/drift.html").read_text(encoding="utf-8")
assert "data.active_alerts" in source
assert "uisp.active_events" in source
assert "Ignorér enhed fremover" in source
assert "/api/v1/drift/ignore-rules" in source
assert "Overvåg igen" in source
assert "drift-attention-filter" in source
assert "formatDriftDuration" in source
assert "Opsætning, kundemapping og ignorerede enheder" in source
def test_drift_backend_keeps_ignore_rules_reversible_and_source_scoped():
source = Path("app/modules/drift/backend/router.py").read_text(encoding="utf-8")
assert "CREATE TABLE IF NOT EXISTS drift_ignore_rules" in source
assert "UNIQUE (source_id, external_id)" in source
assert "SET is_active = FALSE" in source
assert "_event_matches_ignore_rule" in source
assert "IN ('active', 'warning', 'critical', 'new')" in source