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
ef08e5a2
Commit
ef08e5a2
authored
May 08, 2026
by
Eric Duminil
Browse files
Adding tests for UnknownWorkflow
parent
3974a5de
Changes
2
Show whitespace changes
Inline
Side-by-side
src/simstadt/__init__.py
View file @
ef08e5a2
...
@@ -6,6 +6,7 @@ from .results import (
...
@@ -6,6 +6,7 @@ from .results import (
PhotovoltaicResults
,
PhotovoltaicResults
,
SimStadtResults
,
SimStadtResults
,
SolarPotentialResults
,
SolarPotentialResults
,
UnknownWorkflowResults
,
create_simstadt_results
,
create_simstadt_results
,
)
)
from
.runner
import
run_workflow_with_citygml
,
run_regionchooser
,
get_version_and_date
from
.runner
import
run_workflow_with_citygml
,
run_regionchooser
,
get_version_and_date
...
@@ -22,6 +23,7 @@ __all__ = [
...
@@ -22,6 +23,7 @@ __all__ = [
"PhotovoltaicResults"
,
"PhotovoltaicResults"
,
"SimStadtResults"
,
"SimStadtResults"
,
"SolarPotentialResults"
,
"SolarPotentialResults"
,
"UnknownWorkflowResults"
,
"clean_old_workflows"
,
"clean_old_workflows"
,
"create_simstadt_results"
,
"create_simstadt_results"
,
"get_version_and_date"
,
"get_version_and_date"
,
...
...
tests/test_results.py
View file @
ef08e5a2
"""Tests for SimStadtResults subclasses using pre-calculated output files."""
"""Tests for SimStadtResults subclasses using pre-calculated output files."""
import
logging
from
pathlib
import
Path
from
pathlib
import
Path
import
pandas
as
pd
import
pandas
as
pd
...
@@ -13,6 +14,7 @@ from simstadt import (
...
@@ -13,6 +14,7 @@ from simstadt import (
PhotovoltaicResults
,
PhotovoltaicResults
,
SimStadtResults
,
SimStadtResults
,
SolarPotentialResults
,
SolarPotentialResults
,
UnknownWorkflowResults
,
create_simstadt_results
,
create_simstadt_results
,
)
)
...
@@ -612,3 +614,21 @@ def test_broken_simulation():
...
@@ -612,3 +614,21 @@ def test_broken_simulation():
results
.
to_json
()
results
.
to_json
()
with
pytest
.
raises
(
ValueError
,
match
=
"any CSV file"
):
with
pytest
.
raises
(
ValueError
,
match
=
"any CSV file"
):
results
.
kpis
results
.
kpis
# ---------------------------------------------------------------------------
# Unknown workflow
# ---------------------------------------------------------------------------
def
test_unknown_workflow_results
(
caplog
):
output_files
=
[
TEST_PROJECT_PATH
/
"UnknownWorkflow.flow/output.step/result.log"
,
]
with
caplog
.
at_level
(
logging
.
WARNING
):
results
=
create_simstadt_results
(
"Unknown workflow test"
,
output_files
)
assert
isinstance
(
results
,
UnknownWorkflowResults
)
assert
"com.example.SomeFutureWorkflowProvider"
in
caplog
.
text
assert
results
.
kpis
==
[]
assert
results
.
dataframe
.
empty
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