fixed recommendation utils unit tests

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-30 16:03:57 +01:00
parent 7263d83a42
commit f06233eeef

View file

@ -88,8 +88,8 @@ class TestRecommendationUtils:
def test_get_roof_u_value_case_3(self):
inputs = {
'original_description': 'Room-in-roof, 200 mm insulation at rafters',
'clean_description': 'Room-in-roof, 200 mm insulation at rafters',
'original_description': 'Room-in-roof, insulated at rafters',
'clean_description': 'Room-in-roof, insulated at rafters',
'thermal_transmittance': None,
'thermal_transmittance_unit': None,
'is_pitched': False,
@ -101,12 +101,12 @@ class TestRecommendationUtils:
'is_assumed': False,
'has_dwelling_above': False,
'is_valid': True,
'insulation_thickness': '200',
'insulation_thickness': 'average',
'age_band': "J"
}
u_value = recommendation_utils.get_roof_u_value(**inputs)
assert u_value == 0.21, f"Expected 0.21, but got {u_value}"
assert u_value == 0.4, f"Expected 0.4, but got {u_value}"
def test_get_roof_u_value_case_4(self):
inputs = {
@ -179,8 +179,8 @@ class TestRecommendationUtils:
def test_get_roof_u_value_case_7(self):
# Test case where the roof has a room in it
inputs = {
'original_description': 'Pitched, room-in-roof, 100mm insulation',
'clean_description': 'Pitched, room-in-roof, 100mm insulation',
'original_description': 'Pitched, room-in-roof, above average insulation',
'clean_description': 'Pitched, room-in-roof, above average insulation',
'thermal_transmittance': None,
'thermal_transmittance_unit': None,
'is_pitched': True,
@ -192,12 +192,12 @@ class TestRecommendationUtils:
'is_assumed': False,
'has_dwelling_above': False,
'is_valid': True,
'insulation_thickness': '100',
'insulation_thickness': 'above average',
'age_band': "J"
}
u_value = recommendation_utils.get_roof_u_value(**inputs)
assert u_value == 0.40, f"Expected 0.40, but got {u_value}"
assert u_value == 0.16, f"Expected 0.16, but got {u_value}"
def test_get_roof_u_value_case_8(self):
# Test case where there is a dwelling above the roof, U-value should be 0