Added pytest.mark.parameterize to roof tests

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-14 11:45:15 +01:00
parent e9dcaaafe3
commit 2745076f19
2 changed files with 11 additions and 15 deletions

View file

@ -52,13 +52,17 @@ class TestRoofAttributes:
assert result == expected_output
for test_case in clean_roof_test_cases:
result = RoofAttributes(test_case['original_description']).process()
# Ensure the output ordering is correct
expected_result = {key: test_case[key] for key in result.keys()}
expected_result["desc"] = test_case["original_description"]
result["desc"] = test_case["original_description"]
assert result == expected_result
@pytest.mark.parametrize(
"test_case",
clean_roof_test_cases
)
def test_process(self, test_case):
expected_result = test_case.copy()
del expected_result["original_description"]
result = RoofAttributes(test_case['original_description']).process()
# Ensure the output ordering is correct
# Ensure the output ordering is correct
assert sorted(result.items()) == sorted(expected_result.items())
def test_clean_roof_with_dwelling_above(self):
result = RoofAttributes('(another dwelling above)').process()

View file

@ -48,13 +48,5 @@ class TestWallAttributes:
expected_result = test_case.copy()
del expected_result["original_description"]
result = WallAttributes(test_case['original_description']).process()
assert set(result.keys()) == {
'is_as_built', 'is_assumed', 'is_sandstone_or_limestone', 'thermal_transmittance',
'is_cavity_wall', 'is_filled_cavity', 'is_system_built',
'external_insulation', 'is_solid_brick', 'is_timber_frame', 'internal_insulation',
'is_cob', 'is_granite_or_whinstone', 'insulation_thickness',
'thermal_transmittance_unit'
}
# Ensure the output ordering is correct
assert sorted(result.items()) == sorted(expected_result.items())