diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index 2631a9973..7d8dedfc6 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -2769,6 +2769,34 @@ class TestPasHubMainHeatingControlCoding: assert main.main_heating_control == 2601 assert _control_type(main) == 2 + def test_gas_room_heater_type_maps_to_table_4a_code_603(self) -> None: + # Arrange — a gas room-heater main system (verbatim fixture + # 500797805807 lodgement): open flue, 1980+, open fronted, sealed to + # fireplace → Table 4a code 603 (PCDB "sitting proud of, and sealed + # to, fireplace opening", eff 63%). 604 (with back boiler) and 605 + # (flush-fitting live fuel effect) rejected — neither qualifier is in + # the label. + raw = load("pashub_rdsap_site_notes_example1.json") + mh = raw["heating_and_hot_water"]["main_heating"] + mh["system_type"] = "Room heaters" + mh["community_heat_source"] = ( + "Gas fire, Open flue, 1980 or later (Open fronted), " + "Sealed to fireplace" + ) + mh["fuel"] = "Mains Gas" + mh["product_id"] = 0 + mh["controls"] = "No thermostatic control of room temperature" + survey = from_dict(PasHubRdSapSiteNotes, raw) + + # Act + main = EpcPropertyDataMapper.from_site_notes( + survey + ).sap_heating.main_heating_details[0] + + # Assert — the gas Table 4a row and the mains-gas fuel code. + assert main.sap_main_heating_code == 603 + assert main.main_fuel_type == 26 + @pytest.mark.parametrize( "heater_type, expected_system_code", [