debugging windows recommendation tests

This commit is contained in:
Khalim Conn-Kowlessar 2026-01-20 23:50:14 +00:00
parent 349cf437ed
commit 1a90a04eb7

View file

@ -45,11 +45,13 @@ class TestWindowRecommendations:
epc_record=epc_record
)
property_1.windows = {
'original_description': 'Single glazed', 'has_glazing': False, 'glazing_coverage': 'full',
'original_description': 'Single glazed', 'clean_description': 'Single glazed',
'has_glazing': False, 'glazing_coverage': 'full',
'glazing_type': 'single',
'no_data': False
}
property_1.number_of_windows = 7
property_1.already_installed = []
recommender = WindowsRecommendations(property_instance=property_1, materials=materials)
@ -59,25 +61,16 @@ class TestWindowRecommendations:
# The home is going from single glazing (v poor energy eff) -> double glazing (average energy eff)
assert recommender.recommendation == [
{
'phase': 0, 'parts': [], 'type': 'windows_glazing', "measure_type": "double_glazing",
'description': 'Install double glazing to all windows',
'starting_u_value': None, 'new_u_value': None, 'sap_points': None, 'already_installed': False,
'total': 7980.0, 'labour_hours': 0.0, 'labour_days': 0.0, 'is_secondary_glazing': False,
'description_simulation': {
'multi-glaze-proportion': 100, 'windows-energy-eff': 'Good',
'windows-description': 'Fully double glazed',
'glazed-type': 'double glazing installed during or after 2002'
},
'simulation_config': {
'has_glazing_ending': True, 'glazing_type_ending': 'double',
'multi_glaze_proportion_ending': 100, 'windows_energy_eff_ending': 'Good',
'glazed_type_ending': 'double glazing installed during or after 2002'
},
"survey": None
}
]
assert len(recommender.recommendation) == 1
assert recommender.recommendation[0]["total"] == np.float64(7980.0)
assert recommender.recommendation[0]["phase"] == 0
assert recommender.recommendation[0]["description"] == 'Install double glazing to all windows'
assert recommender.recommendation[0]["contingency"] == np.float64(1197.0)
assert recommender.recommendation[0]["simulation_config"] == {
'has_glazing_ending': True, 'glazing_type_ending': 'double',
'multi_glaze_proportion_ending': 100, 'windows_energy_eff_ending': 'Good',
'glazed_type_ending': 'double glazing installed during or after 2002'
}
def test_partial_double_glazed(self):
"""
@ -322,10 +315,14 @@ class TestWindowRecommendations:
address='1',
epc_record=epc_record
)
property_8.windows = {'original_description': 'Mostly triple glazing', 'has_glazing': True,
'glazing_coverage': 'most',
'glazing_type': 'triple', 'no_data': False}
property_8.windows = {
'original_description': 'Mostly triple glazing', 'clean_description': 'Mostly triple glazing',
'has_glazing': True,
'glazing_coverage': 'most',
'glazing_type': 'triple', 'no_data': False
}
property_8.number_of_windows = 7
property_8.already_installed = []
recommender8 = WindowsRecommendations(property_instance=property_8, materials=materials)