"""The one-time heating-override re-classification map is internally valid.""" from __future__ import annotations from domain.epc.property_overlays.main_heating_system_overlay import ( main_heating_overlay_for, ) from domain.epc.property_overrides.main_heating_system_type import ( MainHeatingSystemType, ) from scripts.reclassify_heating_overrides import REMAP def test_every_remap_target_is_a_resolvable_archetype() -> None: # The remap must never point a stored description at an archetype the overlay # can't model — that would replace one broken value with another. Every # target must decode to a real SAP heating code (ADR-0041). for description, archetype in REMAP.items(): simulation = main_heating_overlay_for(archetype.value, 0) assert simulation is not None, description assert simulation.heating is not None, description assert simulation.heating.sap_main_heating_code is not None, description def test_remap_targets_are_main_heating_system_members() -> None: # Belt and braces: the values are enum members (a typo can't smuggle a # non-archetype string into the DB). for archetype in REMAP.values(): assert archetype in MainHeatingSystemType