fixing unit tests

This commit is contained in:
Khalim Conn-Kowlessar 2023-12-21 11:27:22 +00:00
parent e65d190e19
commit 5de6b3f029
2 changed files with 13 additions and 7 deletions

View file

@ -80,7 +80,7 @@ class WindowAttributes(Definitions):
break
# If we didn't find any coverage or type, we assume full coverage
if not result["glazing_coverage"]:
if (not result["glazing_coverage"]) & (result["glazing_type"] != "single"):
result["glazing_coverage"] = "full"
# We reset some values if the glazing is single

View file

@ -3,12 +3,13 @@ from pathlib import Path
from etl.epc_clean.tests.test_data.test_roof_attributes_cases import clean_roof_test_cases
from etl.epc_clean.epc_attributes.RoofAttributes import RoofAttributes
# For local testing
if __file__ == "<input>":
input_data_path = Path("./model_data/tests/test_data/EpcClean_inputs.obj")
else:
current_file_path = Path(__file__)
input_data_path = current_file_path.parent / 'test_data' / 'EpcClean_inputs.obj'
# if __file__ == "<input>":
# input_data_path = Path("./model_data/tests/test_data/EpcClean_inputs.obj")
# else:
# current_file_path = Path(__file__)
# input_data_path = current_file_path.parent / 'test_data' / 'EpcClean_inputs.obj'
class TestRoofAttributes:
@ -88,7 +89,12 @@ class TestRoofAttributes:
def test_clean_roof_no_description(self):
roof = RoofAttributes('').process()
assert roof == {}
assert roof == {
'thermal_transmittance': False, 'thermal_transmittance_unit': False, 'is_pitched': False,
'is_roof_room': False, 'is_loft': False, 'is_flat': False, 'is_thatched': False,
'is_at_rafters': False, 'is_assumed': False, 'has_dwelling_above': False, 'is_valid': False,
'insulation_thickness': False
}
def test_clean_roof_edge_cases(self):
# Insulation thickness edge case