Added another unit test for heating recommendations

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-16 13:57:36 +01:00
parent c4ab7f5a2c
commit 342f926415
3 changed files with 19 additions and 7 deletions

View file

@ -1224,7 +1224,15 @@ class Property:
if "air_source_heat_pump" not in measures:
return False
suitable_property_type = self.data["property-type"] in ["House", "Bungalow"]
suitable_house = self.data["property-type"] == "House" and self.data["built-form"] in [
"Detached", "Semi-Detached",
]
suitable_bungalow = self.data["property-type"] == "Bungalow" and self.data["built-form"] in [
"Detached", "Semi-Detached"
]
suitable_property_type = suitable_house or suitable_bungalow
has_air_source_heat_pump = self.main_heating["has_air_source_heat_pump"]
return suitable_property_type and not has_air_source_heat_pump

View file

@ -405,11 +405,18 @@ testing_examples = [
'construction-age-band': 'England and Wales: 1930-1949',
'lodgement-datetime': '2013-07-23 14:20:29', 'tenure': 'owner-occupied',
'fixed-lighting-outlets-count': 10.0, 'low-energy-fixed-light-count': 9.0, 'uprn': 100070358594,
'uprn-source': 'Address Matched'
'uprn-source': 'Address Matched', 'sheating-energy-eff': None, 'sheating-env-eff': None
},
"heating_recommendation_descriptions": [],
"heating_recommendation_descriptions": [
'Upgrade to a new condensing boiler upgrade heating controls to Room thermostat, programmer and TRVs',
'Install high heat retention electric storage heaters. upgrade heating controls to High Heat Retention '
'Storage Heater Controls',
'Upgrade to a new condensing boiler upgrade heating controls to Smart Thermostats, room sensors and smart '
'radiator valves (time & temperature zone control)'
],
"heating_controls_recommendation_descriptions": [],
"notes": ""
"notes": "This property has assumed electric heating and is mid-terrace house. It has a mains gas connection."
"We can recommend a boiler upgrade and high heat retention storage heaters"
}
]

View file

@ -54,9 +54,6 @@ class TestHeatingRecommendations:
:return:
"""
if test_case["epc"]["uprn"] == 100021560521:
raise Exception("Finish this test - could do so while on the train")
epc_records = {"original_epc": test_case["epc"].copy(), "full_sap_epc": {}, "old_data": []}
epc_record = EPCRecord(