From dcb2f7cabaaae9f080baf2c953891f17376bf40a Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 22 Sep 2023 21:07:53 +0100 Subject: [PATCH] updated unit tests for updated uvalue methodlogy --- backend/tests/test_property.py | 21 ++++++++++++------- .../test_data/test_wall_attributes_cases.py | 4 ++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/backend/tests/test_property.py b/backend/tests/test_property.py index 679b25b0..8d392bab 100644 --- a/backend/tests/test_property.py +++ b/backend/tests/test_property.py @@ -30,7 +30,8 @@ mock_epc_response = { "unheated-corridor-length": 0, "mains-gas-flag": "Y", "floor-height": 2.5, - "total-floor-area": 100 + "total-floor-area": 100, + "construction-age-band": "England and Wales: 1967-1975" }, { "inspection-date": "2023-05-01", @@ -53,7 +54,8 @@ mock_epc_response = { "unheated-corridor-length": 0, "mains-gas-flag": "Y", "floor-height": 2.5, - "total-floor-area": 100 + "total-floor-area": 100, + "construction-age-band": "England and Wales: 1967-1975" } ] } @@ -77,7 +79,8 @@ mock_epc_response_dupe = { "unheated-corridor-length": 0, "mains-gas-flag": "Y", "floor-height": 2.5, - "total-floor-area": 100 + "total-floor-area": 100, + "construction-age-band": "England and Wales: 1967-1975" }, { 'inspection-date': '2023-05-01', 'some-other-key': 'some-other-value', @@ -97,7 +100,8 @@ mock_epc_response_dupe = { "unheated-corridor-length": 0, "mains-gas-flag": "Y", "floor-height": 2.5, - "total-floor-area": 100 + "total-floor-area": 100, + "construction-age-band": "England and Wales: 1967-1975" }, { 'inspection-date': '2023-06-01', 'some-other-key': 'duplicate-date', @@ -117,7 +121,8 @@ mock_epc_response_dupe = { "unheated-corridor-length": 0, "mains-gas-flag": "Y", "floor-height": 2.5, - "total-floor-area": 100 + "total-floor-area": 100, + "construction-age-band": "England and Wales: 1967-1975" } ] } @@ -126,11 +131,13 @@ mock_epc_response_dupe = { class TestProperty: @pytest.fixture(autouse=True) def property_instance(self, mock_epc_client, mock_open_uprn_client, mock_cleaner): - return Property(1, "AB12CD", "Test Address", epc_client=mock_epc_client) + property_instance = Property(1, "AB12CD", "Test Address", epc_client=mock_epc_client) + return property_instance @pytest.fixture(autouse=True) def property_instance_dupe_data(self, mock_epc_client_dupe_data): - return Property(2, "AB12CD", "Test Address", epc_client=mock_epc_client_dupe_data) + property_instance_dupe_data = Property(2, "AB12CD", "Test Address", epc_client=mock_epc_client_dupe_data) + return property_instance_dupe_data @pytest.fixture def mock_epc_client(self): diff --git a/model_data/tests/test_data/test_wall_attributes_cases.py b/model_data/tests/test_data/test_wall_attributes_cases.py index d14a5305..40d6fb9c 100644 --- a/model_data/tests/test_data/test_wall_attributes_cases.py +++ b/model_data/tests/test_data/test_wall_attributes_cases.py @@ -740,8 +740,8 @@ wall_cases = [ {'original_description': 'Waliau ceudod,', 'thermal_transmittance': None, 'thermal_transmittance_unit': None, 'is_cavity_wall': True, 'is_filled_cavity': False, 'is_solid_brick': False, 'is_system_built': False, 'is_timber_frame': False, - 'is_granite_or_whinstone': False, 'is_as_built': False, 'is_cob': False, 'is_assumed': False, - 'is_sandstone_or_limestone': False, 'insulation_thickness': None, 'external_insulation': False, + 'is_granite_or_whinstone': False, 'is_as_built': True, 'is_cob': False, 'is_assumed': False, + 'is_sandstone_or_limestone': False, 'insulation_thickness': 'none', 'external_insulation': False, 'internal_insulation': False}, {'original_description': 'Ffr+óm bren, fel yGÇÖu hadeiladwyd, wediGÇÖu hinswleiddio (rhagdybiaeth)', 'thermal_transmittance': None,