接入test_mql真实固定气室拓扑
This commit is contained in:
1 parent
c0f28520b4
commit
2d33a8f4bc
8 files changed
+747
-5
No files matched your search
@@ -0,0 +1,45 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from PythonModels.systems.test_mql_topology import load_test_mql_cir_topology
|
||||
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
TEST_MQL_AME = REPO_ROOT / "AmesimModels" / "test_mql.ame"
|
||||
|
||||
|
||||
class TestMqlCirTopologyTests(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls) -> None:
|
||||
cls.topology = load_test_mql_cir_topology(TEST_MQL_AME)
|
||||
|
||||
def test_recovers_direct_component_contacts_omitted_from_line_specs(self) -> None:
|
||||
self.assertEqual(len(self.topology.component_contacts), 54)
|
||||
contacts = self.topology.contacts_for("pn_general_chamber")
|
||||
|
||||
self.assertEqual(len(contacts), 2)
|
||||
self.assertEqual(
|
||||
{
|
||||
(
|
||||
contact.port_for("pn_general_chamber"),
|
||||
*contact.other_endpoint("pn_general_chamber"),
|
||||
)
|
||||
for contact in contacts
|
||||
},
|
||||
{
|
||||
("port_1", "pn_orifice_19", "port_2"),
|
||||
("port_2", "pn_orifice_18", "port_1"),
|
||||
},
|
||||
)
|
||||
|
||||
def test_component_contact_lookup_rejects_unrelated_alias(self) -> None:
|
||||
contact = self.topology.contacts_for("pn_general_chamber")[0]
|
||||
|
||||
with self.assertRaises(KeyError):
|
||||
contact.other_endpoint("not-an-endpoint")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user