diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index 53917b864..862f301af 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -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)