Added pytest.mark.paramterize to floor tests

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-14 11:46:39 +01:00
parent 2745076f19
commit 3847331e9d
2 changed files with 10 additions and 9 deletions

View file

@ -19,14 +19,16 @@ class TestCleanFloor:
with pytest.raises(ValueError):
FloorAttributes('description without keywords')
def test_process_floor(self):
for test_case in clean_floor_cases:
result = FloorAttributes(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_floor_cases
)
def test_process_floor(self, test_case):
expected_result = test_case.copy()
del expected_result["original_description"]
result = FloorAttributes(test_case['original_description']).process()
# Ensure the output ordering is correct
assert sorted(result.items()) == sorted(expected_result.items())
def test_invalid_description(self):
# Test that invalid descriptions raise a ValueError

View file

@ -61,7 +61,6 @@ class TestRoofAttributes:
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):