"""Unit tests for the injector public surfaces. AZ-406 commits to the type signatures + the NotImplementedError pointer. AZ-408 will replace each NotImplementedError with a real generator; these tests will then be updated alongside the implementation. """ from __future__ import annotations from pathlib import Path import pytest from fixtures.injectors.blackout_spoof import BlackoutSpoofPlan from fixtures.injectors.blackout_spoof import build as build_blackout_spoof from fixtures.injectors.cold_boot import ColdBootFixture from fixtures.injectors.cold_boot import load as load_cold_boot from fixtures.injectors.multi_segment import MultiSegmentPlan from fixtures.injectors.multi_segment import build as build_multi_segment from fixtures.injectors.outlier import OutlierInjectionPlan from fixtures.injectors.outlier import build as build_outlier def test_outlier_plan_dataclass_is_frozen() -> None: plan = OutlierInjectionPlan(target_segment_seconds=(0.0, 5.0)) with pytest.raises(AttributeError): plan.max_offset_m = 999.0 # type: ignore[misc] assert plan.max_offset_m == 350.0 def test_outlier_build_raises_until_az408_lands() -> None: with pytest.raises(NotImplementedError, match="AZ-408"): build_outlier(OutlierInjectionPlan(target_segment_seconds=(0.0, 5.0)), Path("/tmp")) def test_blackout_spoof_plan_round_trip() -> None: plan = BlackoutSpoofPlan(blackout_seconds=35.0, spoof_offset_m=120.0, spoof_bearing_deg=90.0) assert plan.blackout_seconds == 35.0 with pytest.raises(NotImplementedError, match="AZ-408"): build_blackout_spoof(plan, Path("/tmp")) def test_multi_segment_plan_defaults() -> None: plan = MultiSegmentPlan() assert plan.n_segments == 3 with pytest.raises(NotImplementedError, match="AZ-408"): build_multi_segment(plan, Path("/tmp")) def test_cold_boot_fixture_dataclass_is_frozen() -> None: fx = ColdBootFixture( lat_deg=50.0, lon_deg=30.0, alt_m=300.0, yaw_deg=180.0, last_valid_fix_age_s=2.5 ) with pytest.raises(AttributeError): fx.alt_m = 999.0 # type: ignore[misc] def test_cold_boot_load_raises_until_az419_lands(tmp_path: Path) -> None: fixture_path = tmp_path / "cold_boot_fixture.json" fixture_path.write_text("{}", encoding="utf-8") with pytest.raises(NotImplementedError, match="AZ-419"): load_cold_boot(fixture_path)