Files
SystemSimulationApp/tests/test_simulation_paths.py
T
ljz bbc88a6bbb 规范仿真模型库并完善前端交互
归档仿真模型并补充组件目录、建模规范与校验。

完善控制台、默认节点、视图适配及前端自动化测试。
2026-07-29 15:44:16 +08:00

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()