From f06233eeef580be8accdf05cc31d947ba45f9c62 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 30 Sep 2024 16:03:57 +0100 Subject: [PATCH] fixed recommendation utils unit tests --- .../tests/test_recommendation_utils.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recommendations/tests/test_recommendation_utils.py b/recommendations/tests/test_recommendation_utils.py index 559a51b2..543d5319 100644 --- a/recommendations/tests/test_recommendation_utils.py +++ b/recommendations/tests/test_recommendation_utils.py @@ -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