mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Added addition rir recommendation unit tests
This commit is contained in:
parent
973d7ab6ee
commit
a565d63836
1 changed files with 84 additions and 86 deletions
|
|
@ -193,92 +193,90 @@ class TestRoofRecommendations:
|
|||
assert roof_recommender7.recommendations[0]["starting_u_value"] == 1.5
|
||||
assert roof_recommender7.recommendations[0]["description"] == "Insulate room in roof at rafters and re-decorate"
|
||||
|
||||
# def test_ceiling_insulated_room_in_roof(self):
|
||||
# property_instance8 = Property(id=8, address1="fake", postcode="fake", epc_client=Mock())
|
||||
# property_instance8.age_band = "F"
|
||||
# property_instance8.insulation_floor_area = 100
|
||||
# property_instance8.roof = {
|
||||
# 'original_description': 'Roof room(s), ceiling insulated',
|
||||
# 'clean_description': 'Roof room(s), ceiling insulated',
|
||||
# 'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False,
|
||||
# 'is_roof_room': True, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
|
||||
# 'is_at_rafters': False,
|
||||
# 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
|
||||
# 'insulation_thickness': 'average'
|
||||
# }
|
||||
#
|
||||
# property_instance8.pitched_roof_area = 110
|
||||
#
|
||||
# roof_recommender8 = RoofRecommendations(property_instance=property_instance8, materials=materials)
|
||||
#
|
||||
# assert not roof_recommender8.recommendations
|
||||
#
|
||||
# roof_recommender8.recommend()
|
||||
#
|
||||
# # No recommendations in this case
|
||||
# assert not roof_recommender8.recommendations
|
||||
#
|
||||
# def test_insulated_room_in_roof(self):
|
||||
# property_instance9 = Property(id=9, address1="fake", postcode="fake", epc_client=Mock())
|
||||
# property_instance9.age_band = "F"
|
||||
# property_instance9.insulation_floor_area = 100
|
||||
# property_instance9.roof = {
|
||||
# 'original_description': 'Roof room(s), insulated (assumed)',
|
||||
# 'clean_description': 'Roof room(s), insulated',
|
||||
# 'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False,
|
||||
# 'is_roof_room': True, 'is_loft': False, 'is_flat': False, 'is_thatched': False, 'is_at_rafters': False,
|
||||
# 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True, 'insulation_thickness': 'average'
|
||||
# }
|
||||
#
|
||||
# property_instance9.pitched_roof_area = 110
|
||||
# property_instance9.data = {"county": "Rutland"}
|
||||
#
|
||||
# roof_recommender9 = RoofRecommendations(property_instance=property_instance9, materials=materials)
|
||||
#
|
||||
# assert not roof_recommender9.recommendations
|
||||
#
|
||||
# roof_recommender9.recommend()
|
||||
#
|
||||
# # No recommendations in this case
|
||||
# assert not roof_recommender9.recommendations
|
||||
#
|
||||
# def test_limited_insulated_room_in_roof(self):
|
||||
# property_instance10 = Property(id=10, address1="fake", postcode="fake", epc_client=Mock())
|
||||
# property_instance10.age_band = "F"
|
||||
# property_instance10.insulation_floor_area = 100
|
||||
# property_instance10.roof = {
|
||||
# 'original_description': 'Roof room(s), limited insulation (assumed)',
|
||||
# 'clean_description': 'Roof room(s), limited insulation',
|
||||
# 'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False,
|
||||
# 'is_roof_room': True, 'is_loft': False, 'is_flat': False, 'is_thatched': False, 'is_at_rafters': False,
|
||||
# 'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
|
||||
# 'insulation_thickness': 'below average'
|
||||
# }
|
||||
#
|
||||
# property_instance10.pitched_roof_area = 110
|
||||
# property_instance10.data = {"county": "Westmorland"}
|
||||
#
|
||||
# roof_recommender10 = RoofRecommendations(property_instance=property_instance10, materials=materials)
|
||||
#
|
||||
# assert not roof_recommender10.recommendations
|
||||
#
|
||||
# roof_recommender10.recommend()
|
||||
#
|
||||
# assert len(roof_recommender10.recommendations) == 2
|
||||
#
|
||||
# assert roof_recommender10.recommendations[0]["parts"][0]["depths"] == [220]
|
||||
# assert roof_recommender10.recommendations[1]["parts"][0]["depths"] == [270]
|
||||
#
|
||||
# assert roof_recommender10.recommendations[0]["new_u_value"] == 0.16
|
||||
# assert roof_recommender10.recommendations[1]["new_u_value"] == 0.14
|
||||
#
|
||||
# assert roof_recommender10.recommendations[0]["starting_u_value"] == 0.8
|
||||
# assert roof_recommender10.recommendations[1]["starting_u_value"] == 0.8
|
||||
#
|
||||
# assert roof_recommender10.recommendations[0]["description"] == \
|
||||
# "Insulate your room roof with 220mm of Example room roof insulation"
|
||||
# assert roof_recommender10.recommendations[1]["description"] == \
|
||||
# "Insulate your room roof with 270mm of Example room roof insulation"
|
||||
def test_ceiling_insulated_room_in_roof(self):
|
||||
epc_record = EPCRecord()
|
||||
epc_record.prepared_epc = {"county": "Southampton", "roof-energy-eff": "Very Poor"}
|
||||
property_instance8 = Property(id=8, address="fake", postcode="fake", epc_record=epc_record)
|
||||
property_instance8.age_band = "F"
|
||||
property_instance8.insulation_floor_area = 100
|
||||
property_instance8.roof = {
|
||||
'original_description': 'Roof room(s), ceiling insulated',
|
||||
'clean_description': 'Roof room(s), ceiling insulated',
|
||||
'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False,
|
||||
'is_roof_room': True, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
|
||||
'is_at_rafters': False,
|
||||
'is_assumed': False, 'has_dwelling_above': False, 'is_valid': True,
|
||||
'insulation_thickness': 'average'
|
||||
}
|
||||
|
||||
property_instance8.pitched_roof_area = 110
|
||||
|
||||
roof_recommender8 = RoofRecommendations(property_instance=property_instance8, materials=materials)
|
||||
|
||||
assert not roof_recommender8.recommendations
|
||||
|
||||
roof_recommender8.recommend(phase=0)
|
||||
|
||||
# No recommendations in this case
|
||||
assert not roof_recommender8.recommendations
|
||||
|
||||
def test_insulated_room_in_roof(self):
|
||||
epc_record = EPCRecord()
|
||||
epc_record.prepared_epc = {"county": "Southampton", "roof-energy-eff": "Very Poor"}
|
||||
property_instance9 = Property(id=9, address="fake", postcode="fake", epc_record=epc_record)
|
||||
property_instance9.age_band = "F"
|
||||
property_instance9.insulation_floor_area = 100
|
||||
property_instance9.roof = {
|
||||
'original_description': 'Roof room(s), insulated (assumed)',
|
||||
'clean_description': 'Roof room(s), insulated',
|
||||
'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False,
|
||||
'is_roof_room': True, 'is_loft': False, 'is_flat': False, 'is_thatched': False, 'is_at_rafters': False,
|
||||
'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True, 'insulation_thickness': 'average'
|
||||
}
|
||||
|
||||
property_instance9.pitched_roof_area = 110
|
||||
property_instance9.data = {"county": "Rutland"}
|
||||
|
||||
roof_recommender9 = RoofRecommendations(property_instance=property_instance9, materials=materials)
|
||||
|
||||
assert not roof_recommender9.recommendations
|
||||
|
||||
roof_recommender9.recommend(phase=0)
|
||||
|
||||
# No recommendations in this case
|
||||
assert not roof_recommender9.recommendations
|
||||
|
||||
def test_limited_insulated_room_in_roof(self):
|
||||
epc_record = EPCRecord()
|
||||
epc_record.prepared_epc = {"county": "Westmorland", "roof-energy-eff": "Poor"}
|
||||
property_instance10 = Property(id=10, address="fake", postcode="fake", epc_record=epc_record)
|
||||
property_instance10.age_band = "F"
|
||||
property_instance10.insulation_floor_area = 100
|
||||
property_instance10.roof = {
|
||||
'original_description': 'Roof room(s), limited insulation (assumed)',
|
||||
'clean_description': 'Roof room(s), limited insulation',
|
||||
'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_pitched': False,
|
||||
'is_roof_room': True, 'is_loft': False, 'is_flat': False, 'is_thatched': False, 'is_at_rafters': False,
|
||||
'is_assumed': True, 'has_dwelling_above': False, 'is_valid': True,
|
||||
'insulation_thickness': 'below average'
|
||||
}
|
||||
|
||||
property_instance10.pitched_roof_area = 110
|
||||
|
||||
roof_recommender10 = RoofRecommendations(property_instance=property_instance10, materials=materials)
|
||||
|
||||
assert not roof_recommender10.recommendations
|
||||
|
||||
roof_recommender10.recommend(phase=0)
|
||||
|
||||
assert len(roof_recommender10.recommendations) == 1
|
||||
|
||||
assert roof_recommender10.recommendations[0]["new_u_value"] == 0.19
|
||||
|
||||
assert roof_recommender10.recommendations[0]["starting_u_value"] == 0.68
|
||||
|
||||
assert (roof_recommender10.recommendations[0]["description"] ==
|
||||
'Insulate room in roof at rafters and re-decorate')
|
||||
|
||||
def test_flat_no_insulation(self):
|
||||
epc_record = EPCRecord()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue