From 39b083cee95a8fc01f350c71883cb5cbab7eb3f6 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 12 Sep 2023 13:56:39 +0100 Subject: [PATCH] Fixed hot water cases --- model_data/cleaner_app.py | 6 ++++++ .../tests/test_data/test_hot_water_attributes_cases.py | 4 ++-- model_data/tests/test_hotwater_attributes.py | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/model_data/cleaner_app.py b/model_data/cleaner_app.py index 1ff27a35..9b3314b4 100644 --- a/model_data/cleaner_app.py +++ b/model_data/cleaner_app.py @@ -87,3 +87,9 @@ def app(): s3_file_name="cleaned_epc_data/cleaned.bson", bucket_name=f"retrofit-data-{ENVIRONMENT}" ) + + save_data_to_s3( + data=msgpack.packb(cleaned_data, use_bin_type=True), + s3_file_name="cleaned_epc_data/cleaned.bson", + bucket_name=f"retrofit-data-{ENVIRONMENT}" + ) diff --git a/model_data/tests/test_data/test_hot_water_attributes_cases.py b/model_data/tests/test_data/test_hot_water_attributes_cases.py index a31998fe..2d6f10a0 100644 --- a/model_data/tests/test_data/test_hot_water_attributes_cases.py +++ b/model_data/tests/test_data/test_hot_water_attributes_cases.py @@ -130,13 +130,13 @@ hotwater_cases = [ 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, - {'original_description': 'Oil boiler/circulator', 'heater_type': None, 'system_type': 'oil boiler', + {'original_description': 'Oil boiler/circulator', 'heater_type': 'oil boiler', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, 'extra_features': None, 'chp_systems': None, 'distribution_system': 'circulator', 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'Solid fuel range cooker', 'heater_type': 'solid fuel range cooker', 'system_type': None, 'thermostat_characteristics': None, 'heating_scope': None, 'energy_recovery': None, 'tariff_type': None, - 'extra_features': None, 'chp_systems': None, 'distribution_system': 'circulator', 'no_system_present': None, + 'extra_features': None, 'chp_systems': None, 'distribution_system': None, 'no_system_present': None, 'assumed': False, "appliance": None}, {'original_description': 'OGÇÖr brif system, dim thermostat ar y silindr', 'heater_type': None, 'system_type': 'from main system', 'thermostat_characteristics': 'no cylinder thermostat', 'heating_scope': None, diff --git a/model_data/tests/test_hotwater_attributes.py b/model_data/tests/test_hotwater_attributes.py index 25cd8f40..2df31c51 100644 --- a/model_data/tests/test_hotwater_attributes.py +++ b/model_data/tests/test_hotwater_attributes.py @@ -30,9 +30,13 @@ class TestHotWaterAttributes: invalid_descriptions = [ "invalid description", "description with no known hotwater data_types", - "" ] for description in invalid_descriptions: with pytest.raises(ValueError): HotWaterAttributes(description).process() + + def test_empty_description(self): + processed = HotWaterAttributes("").process() + for _, x in processed.items(): + assert x is None