Commit add17c27 authored by Eric Duminil's avatar Eric Duminil
Browse files

Tests that CSVs are exported, only when desired

parent e031586d
......@@ -41,9 +41,8 @@ def test_heat_demand():
assert kpis["Year of construction"].unit == None
for step in ["Geometric", "Physics", "Usage"]:
for csv in results.get_all_by_extension(".csv"):
if step in csv.name:
pytest.fail(f"{csv.name} should not have been exported")
with pytest.raises(ValueError, match="Workflow didn't seem to have returned any .csv file!"):
results.get_unique_by_extension('.csv', step)
@pytest.mark.integration
......@@ -56,14 +55,14 @@ def test_heat_demand_with_csv():
csv_export=True,
)
output_csvs = [csv.name for csv in results.get_all_by_extension(".csv")]
for step, suffixes in [
("Geometric", ["buildings", "surfaces"]),
("Physics", ["buildings", "surfaces"]),
("Usage", ["buildings"]),
]:
for suffix in suffixes:
assert f"{step}_{TEST_GML.stem}_{suffix}.csv" in output_csvs
found_csv = results.get_unique_by_extension('.csv', step, suffix)
assert found_csv.stat().st_size > 0
@pytest.mark.integration
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment