From b91763fc1dfd4534250af930566d03efe2b89dcb Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 14 Jul 2026 14:34:28 +0000 Subject: [PATCH] =?UTF-8?q?Preserve=20PasHub=20blank-Fuel=20electric-syste?= =?UTF-8?q?m=20inference=20through=20fuel-code=20normalization=20?= =?UTF-8?q?=F0=9F=9F=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../epc/domain/tests/test_from_site_notes.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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