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

Test that CSVs are exported

parent c47561f3
...@@ -40,6 +40,31 @@ def test_heat_demand(): ...@@ -40,6 +40,31 @@ def test_heat_demand():
assert kpis["Year of construction"].value == pytest.approx(1950, abs=50) assert kpis["Year of construction"].value == pytest.approx(1950, abs=50)
assert kpis["Year of construction"].unit == None 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")
@pytest.mark.integration
def test_heat_demand_with_csv():
results = run_workflow_with_citygml(
TEST_TEMPLATES / "01_HeatDemand",
TEST_GML,
project_path=TEST_PROJECT,
description="Heat demand – MiniBuchwald",
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
@pytest.mark.integration @pytest.mark.integration
def test_pv(): def test_pv():
...@@ -83,6 +108,7 @@ def test_load_profile(): ...@@ -83,6 +108,7 @@ def test_load_profile():
assert "Average load" in kpis assert "Average load" in kpis
assert kpis["Number of buildings"].value > 0 assert kpis["Number of buildings"].value > 0
@pytest.mark.integration @pytest.mark.integration
def test_energy_grid(): def test_energy_grid():
results = run_workflow_with_citygml( results = run_workflow_with_citygml(
......
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