39 lines
1.1 KiB
Python
39 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"
|
|
/ "other"
|
|
/ "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_pnrp17_is_marked_as_the_first_public_cross_domain_component(self) -> None:
|
|
text = MATRIX_PATH.read_text(encoding="utf-8")
|
|
row = next(
|
|
line for line in text.splitlines() if "| `PNRP17` |" in line
|
|
)
|
|
|
|
self.assertIn("第一版公开", row)
|
|
self.assertIn("`amesim_pnrp17`", row)
|
|
self.assertNotIn("暂不公开", row)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|