diff --git a/datatypes/epc/domain/tests/test_from_site_notes.py b/datatypes/epc/domain/tests/test_from_site_notes.py index 16ad4f4d8..da5b68768 100644 --- a/datatypes/epc/domain/tests/test_from_site_notes.py +++ b/datatypes/epc/domain/tests/test_from_site_notes.py @@ -2669,6 +2669,33 @@ class TestPasHubMainHeatingControlCoding: ): EpcPropertyDataMapper.from_site_notes(survey) + def test_room_heater_no_thermostatic_control_maps_to_group6_code(self) -> None: + # Arrange — a Table 4e Group 6 room-heater dwelling with the lowest- + # control label: "No thermostatic control of room temperature" → 2601 + # (PCDB `room_heater_systems_controls`, control type 2, +0.3 °C MIT + # adjustment) — one step below the already-mapped 2602. + from domain.sap10_calculator.rdsap.cert_to_inputs import ( + _control_type, # pyright: ignore[reportPrivateUsage] + ) + + 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"] = "Panel, Convector or radiant heaters" + mh["fuel"] = "Electricity" + 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 + assert main.main_heating_control == 2601 + assert _control_type(main) == 2 + def test_heat_network_control_maps_to_group3_code(self) -> None: # Arrange — a Table 4e Group 3 heat network (`system_type = # "Community heating system"`). Its control label carries a Group 3