Files
SystemSimulationApp/tests/test_simulation_paths.py
T

33 lines
956 B
Python

from __future__ import annotations
import unittest
from app.simulation.examples.testmodel.run import prepare_testmodel_run
from app.simulation.paths import (
PROJECT_ROOT,
SIMULATION_BASELINES_DIR,
SIMULATION_RUNS_DIR,
)
class SimulationPathTests(unittest.TestCase):
def test_default_run_paths_are_independent_of_module_depth(self) -> None:
prepared = prepare_testmodel_run()
self.assertEqual(prepared.repo_root, PROJECT_ROOT)
self.assertEqual(prepared.output_dir.parent, SIMULATION_RUNS_DIR)
def test_testmodel_baselines_live_with_the_test_assets(self) -> None:
baseline_dir = SIMULATION_BASELINES_DIR / "testmodel"
self.assertTrue((baseline_dir / "testmodel_primary_series.csv").is_file())
self.assertTrue(
(
baseline_dir / "testmodel_modelica_comparison_summary.txt"
).is_file()
)
if __name__ == "__main__":
unittest.main()