diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index 52598b720..e23d71f57 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -842,3 +842,20 @@ class TestPasHubUnmappedMainFuel: # Act / Assert with pytest.raises(UnmappedPasHubLabel, match="Anthracite"): EpcPropertyDataMapper.from_site_notes(survey) + + def test_blank_fuel_electric_system_resolves_to_electricity_code(self) -> None: + # Arrange — an all-electric system whose surveyed Fuel cell is blank; + # the existing electric-system inference must survive normalization and + # emit the standard-electricity SAP fuel code (30), not the label. + raw = load("pashub_rdsap_site_notes_example1.json") + raw["heating_and_hot_water"]["main_heating"]["fuel"] = "" + raw["heating_and_hot_water"]["main_heating"][ + "system_type" + ] = "Electric storage heaters" + survey = from_dict(PasHubRdSapSiteNotes, raw) + + # Act + result = EpcPropertyDataMapper.from_site_notes(survey) + + # Assert + assert result.sap_heating.main_heating_details[0].main_fuel_type == 30