From 018f7a23f9478c80b758d434feb10f4834f150f2 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 23 Jun 2023 15:27:02 +0100 Subject: [PATCH] Fixed broken test --- model_data/tests/test_wall_recommendations.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/model_data/tests/test_wall_recommendations.py b/model_data/tests/test_wall_recommendations.py index 7a6d1f1c..1d8a5807 100644 --- a/model_data/tests/test_wall_recommendations.py +++ b/model_data/tests/test_wall_recommendations.py @@ -190,10 +190,10 @@ class TestWallRecommendations: class TestWallRecommendationsBase: @pytest.fixture def property_mock(self): - property_instance = MagicMock(spec=Property) - property_instance.full_sap_epc = {"lodgement-date": "1999-12-31"} - property_instance.in_conservation_area = "not_in_conservation_area" - return property_instance + property_mock = MagicMock(spec=Property) + property_mock.full_sap_epc = {"lodgement-date": "1999-12-31"} + property_mock.in_conservation_area = "not_in_conservation_area" + return property_mock @pytest.fixture def uvalue_estimations_mock(self): @@ -217,7 +217,7 @@ class TestWallRecommendationsBase: 'decile_boundaries': np.array([11., 49., 52., 56., 63., 70., 74., 79., 90., 103.8, 1936.])} - uvalue_estimations_mock.classify_decile_newvalues.return_value = "Decile 1" + uvalue_estimations_mock.classify_decile_newvalues.return_value = ["Decile 1"] return uvalue_estimations_mock @pytest.fixture @@ -227,7 +227,6 @@ class TestWallRecommendationsBase: "decile_labels": MagicMock(), "decile_boundaries": MagicMock() } - uvalue_estimations_mock.classify_decile_newvalues.return_value = "Decile 1" return wall_recommendations_instance def test_ewi_valid_in_conservation_area(self, wall_recommendations_instance): @@ -256,7 +255,7 @@ class TestWallRecommendationsBase: "number-heated-rooms": "" } - assert wall_recommendations_instance._get_walls_uvalue_estimate() == 0.2 + assert wall_recommendations_instance._get_walls_uvalue_estimate() == 0.15 def test_recommend_without_u_value(self, wall_recommendations_instance): wall_recommendations_instance.property.walls = {