42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
from PythonModels.systems import 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 = {
|
|
"F000",
|
|
"FORC",
|
|
"LMECHN1",
|
|
"LSTP00A",
|
|
"MECMAS21",
|
|
"PNRP17",
|
|
"STEP0",
|
|
"UD00",
|
|
}
|
|
|
|
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()
|