"""AZ-326 AC-6 — `freshness_threshold_months` returns the documented values.""" from __future__ import annotations import pytest from gps_denied_onboard.components.c12_operator_tooling import ( FRESHNESS_TABLE, SectorClassification, freshness_threshold_months, ) class TestFreshnessTable: def test_active_conflict_is_one_month(self) -> None: # Act / Assert assert freshness_threshold_months(SectorClassification.ACTIVE_CONFLICT) == 1 def test_stable_rear_is_twelve_months(self) -> None: # Act / Assert assert freshness_threshold_months(SectorClassification.STABLE_REAR) == 12 def test_table_covers_every_enum_value(self) -> None: # Arrange enum_values = set(SectorClassification) # Assert assert set(FRESHNESS_TABLE.keys()) == enum_values def test_unknown_classification_raises(self) -> None: # Arrange — synthesise an unmapped value via a subclass to bypass the # enum check in production code (no other path can produce one). class _Bogus: value = "bogus" def __hash__(self) -> int: return hash("bogus") def __eq__(self, other: object) -> bool: return False # Act / Assert with pytest.raises(ValueError, match="unknown SectorClassification"): freshness_threshold_months(_Bogus()) # type: ignore[arg-type]