Commit 817a726d authored by Eric Duminil's avatar Eric Duminil
Browse files

Move templates

parent b525ba4f
...@@ -7,9 +7,10 @@ from simstadt.runner import run_workflow_with_citygml ...@@ -7,9 +7,10 @@ from simstadt.runner import run_workflow_with_citygml
TEST_DATA = Path(__file__).parent / "data" TEST_DATA = Path(__file__).parent / "data"
CITYGML = TEST_DATA / "TestRepo" / "MiniBuchwald.gml" CITYGML = TEST_DATA / "TestRepo" / "MiniBuchwald.gml"
HEAT_TEMPLATE = TEST_DATA / "Templates" / "01_HeatDemand" TEMPLATE_FOLDER = TEST_DATA / "templates"
LOAD_TEMPLATE = TEST_DATA / "Templates" / "02_LoadProfile" HEAT_TEMPLATE = TEMPLATE_FOLDER / "01_HeatDemand"
PV_TEMPLATE = TEST_DATA / "Templates" / "03_PV" LOAD_TEMPLATE = TEMPLATE_FOLDER / "02_LoadProfile"
PV_TEMPLATE = TEMPLATE_FOLDER / "03_PV"
def test_citygml_in_proj_folder(mock_simstadt, tmp_path): def test_citygml_in_proj_folder(mock_simstadt, tmp_path):
...@@ -62,6 +63,22 @@ def test_citygml_with_explicit_project_path_no_double_copy(mock_simstadt, tmp_pa ...@@ -62,6 +63,22 @@ def test_citygml_with_explicit_project_path_no_double_copy(mock_simstadt, tmp_pa
assert results.kpi("Irradiance in module plane").unit == "W / m²" assert results.kpi("Irradiance in module plane").unit == "W / m²"
def test_explicit_project_path_overrides_proj_folder(mock_simstadt, tmp_path):
"""Explicit project_path takes priority even if CityGML is inside a .proj folder."""
src_proj = tmp_path / "Source.proj"
src_proj.mkdir()
gml = src_proj / CITYGML.name
shutil.copy(CITYGML, gml)
dst_proj = tmp_path / "Dest.proj"
dst_proj.mkdir()
results = run_workflow_with_citygml(HEAT_TEMPLATE, gml, project_path=dst_proj)
assert (dst_proj / CITYGML.name).exists()
assert results.workflow_path.parent == dst_proj
def test_citygml_creates_temp_repo(mock_simstadt): def test_citygml_creates_temp_repo(mock_simstadt):
"""CityGML outside .proj with no project_path — temporary repository created.""" """CityGML outside .proj with no project_path — temporary repository created."""
results = run_workflow_with_citygml(HEAT_TEMPLATE, CITYGML) results = run_workflow_with_citygml(HEAT_TEMPLATE, CITYGML)
......
...@@ -8,7 +8,7 @@ from simstadt.results import KPI ...@@ -8,7 +8,7 @@ from simstadt.results import KPI
from simstadt.runner import run_workflow_with_citygml from simstadt.runner import run_workflow_with_citygml
TEST_DATA = Path(__file__).parent / "data" TEST_DATA = Path(__file__).parent / "data"
TEST_TEMPLATES = TEST_DATA / "Templates" TEST_TEMPLATES = TEST_DATA / "templates"
TEST_GML = TEST_DATA / "TestRepo" / "MiniBuchwald.gml" TEST_GML = TEST_DATA / "TestRepo" / "MiniBuchwald.gml"
TEST_PROJECT = TEST_DATA / "TestRepo" / "Temp.proj" TEST_PROJECT = TEST_DATA / "TestRepo" / "Temp.proj"
......
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