Skip to content

Commit

Permalink
test for error message if no reopt data
Browse files Browse the repository at this point in the history
  • Loading branch information
vtnate committed Apr 29, 2024
1 parent a10fa62 commit 259108a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/urbanopt_ditto_reader/test_ditto_reader_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,34 @@ def test_upgrade_transformers(capfd):
# This text is printed by ditto.consistency.fix_undersized_transformers


def test_graceful_error_if_no_reopt(capfd):
reopt_optimization_file = (
Path(__file__).parent.parent.parent
/ "example"
/ "run"
/ "baseline_scenario"
/ "1"
/ "feature_reports"
/ "feature_optimization.csv"
)
assert reopt_optimization_file.exists() is False
subprocess.run(
[
"ditto_reader_cli",
"run-opendss",
"--config",
"example_config.json",
"--upgrade",
"--reopt",
],
cwd=examples_dir,
check=True,
)
captured = capfd.readouterr()
assert "not found" in captured.out
# This text is printed by ditto.consistency.fix_undersized_transformers


# REopt data for testing not present in this repo as of 2023-04-05
# def test_use_reopt(capfd):
# subprocess.run(
Expand Down

0 comments on commit 259108a

Please sign in to comment.