Strict-raise on an unrecognised PasHub main-heating emitter label 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-14 15:17:56 +00:00
parent 5b0f25847c
commit 64e31742b3

View file

@ -858,3 +858,25 @@ class TestPasHubUnmappedMainFuel:
# Assert
assert result.sap_heating.main_heating_details[0].main_fuel_type == 30
class TestPasHubUnmappedHeatEmitter:
"""A PasHub survey whose surveyed main-heating emitter label the mapper does
not yet cover must strict-raise `UnmappedPasHubLabel` at the boundary,
naming the label so a coverage gap is fixed here (a one-line lookup
addition) rather than passed downstream as a raw string to resurface as the
calculator's `UnmappedSapCode: heat_emitter_type`.
"""
def test_unrecognised_emitter_label_raises_naming_the_label(self) -> None:
# Arrange — an example fixture whose emitter cell carries a label the
# Elmhurst emitter map does not cover.
from datatypes.epc.domain.mapper import UnmappedPasHubLabel
raw = load("pashub_rdsap_site_notes_example1.json")
raw["heating_and_hot_water"]["main_heating"]["emitter"] = "Skirting heaters"
survey = from_dict(PasHubRdSapSiteNotes, raw)
# Act / Assert
with pytest.raises(UnmappedPasHubLabel, match="Skirting heaters"):
EpcPropertyDataMapper.from_site_notes(survey)