Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SimStadt
simstadtpy
Commits
add17c27
Commit
add17c27
authored
Aug 04, 2026
by
Eric Duminil
Browse files
Tests that CSVs are exported, only when desired
parent
e031586d
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/test_simulations.py
View file @
add17c27
...
@@ -41,9 +41,8 @@ def test_heat_demand():
...
@@ -41,9 +41,8 @@ def test_heat_demand():
assert
kpis
[
"Year of construction"
].
unit
==
None
assert
kpis
[
"Year of construction"
].
unit
==
None
for
step
in
[
"Geometric"
,
"Physics"
,
"Usage"
]:
for
step
in
[
"Geometric"
,
"Physics"
,
"Usage"
]:
for
csv
in
results
.
get_all_by_extension
(
".csv"
):
with
pytest
.
raises
(
ValueError
,
match
=
"Workflow didn't seem to have returned any .csv file!"
):
if
step
in
csv
.
name
:
results
.
get_unique_by_extension
(
'.csv'
,
step
)
pytest
.
fail
(
f
"
{
csv
.
name
}
should not have been exported"
)
@
pytest
.
mark
.
integration
@
pytest
.
mark
.
integration
...
@@ -56,14 +55,14 @@ def test_heat_demand_with_csv():
...
@@ -56,14 +55,14 @@ def test_heat_demand_with_csv():
csv_export
=
True
,
csv_export
=
True
,
)
)
output_csvs
=
[
csv
.
name
for
csv
in
results
.
get_all_by_extension
(
".csv"
)]
for
step
,
suffixes
in
[
for
step
,
suffixes
in
[
(
"Geometric"
,
[
"buildings"
,
"surfaces"
]),
(
"Geometric"
,
[
"buildings"
,
"surfaces"
]),
(
"Physics"
,
[
"buildings"
,
"surfaces"
]),
(
"Physics"
,
[
"buildings"
,
"surfaces"
]),
(
"Usage"
,
[
"buildings"
]),
(
"Usage"
,
[
"buildings"
]),
]:
]:
for
suffix
in
suffixes
:
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
@
pytest
.
mark
.
integration
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment