Files
SystemSimulationApp/tests/test_amesim_component_migration_matrix.py
T

35 lines
1.1 KiB
Python

from __future__ import annotations
import unittest
from pathlib import Path
from app.simulation.examples.test_mql import system as test_mql
MATRIX_PATH = Path(__file__).resolve().parents[1] / "docs" / "amesim-component-migration-matrix.md"
class AmesimComponentMigrationMatrixTests(unittest.TestCase):
def test_matrix_covers_every_test_mql_submodel_family(self) -> None:
text = MATRIX_PATH.read_text(encoding="utf-8")
families = set(test_mql.SUBMODEL_COUNTS) | set(test_mql.LINE_SUBMODEL_COUNTS)
missing = sorted(family for family in families if f"`{family}`" not in text)
self.assertEqual(missing, [])
def test_unsupported_domains_are_not_marked_as_public_candidates(self) -> None:
text = MATRIX_PATH.read_text(encoding="utf-8")
unsupported = {
"PNRP17",
}
for family in unsupported:
with self.subTest(family=family):
row = next(line for line in text.splitlines() if f"`{family}`" in line)
self.assertIn("暂不公开", row)
if __name__ == "__main__":
unittest.main()