diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index c31793982..b8f6a1377 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -1223,6 +1223,31 @@ class TestSecondaryHeatingTypeCoding: EpcPropertyDataMapper.from_site_notes(survey) +class TestSecondaryFuelTypeCodingDualFuel: + """The secondary-heating survey field lodges the dual-fuel appliance + title-cased ("Dual Fuel Appliance (Mineral and Wood)"), unlike the + sentence-case main-fuel label already mapped — exact-string lookups, so + both tables need their own entry. Same physical fuel, same Table 32 + code 10 the main-fuel path pins.""" + + def test_title_case_dual_fuel_maps_to_table_32_code_10(self) -> None: + # Arrange + data = load("pashub_rdsap_site_notes_example1.json") + data["heating_and_hot_water"]["secondary_heating"][ + "secondary_fuel" + ] = "Dual Fuel Appliance (Mineral and Wood)" + data["heating_and_hot_water"]["secondary_heating"][ + "secondary_system" + ] = "Open fire in grate" + survey = from_dict(PasHubRdSapSiteNotes, data) + + # Act + result = EpcPropertyDataMapper.from_site_notes(survey) + + # Assert + assert result.sap_heating.secondary_fuel_type == 10 + + class TestSecondaryFuelTypeCoding: """`from_site_notes` must int-code the PAS Hub secondary-heating `secondary_fuel` label to the SAP 10.2 Table 32 `secondary_fuel_type`