30 lines
802 B
Python
30 lines
802 B
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from app.simulation.components.amesim.boundary.sources import AmesimPnpl01
|
|
from app.simulation.core.medium import IdealGasMedium
|
|
from app.simulation.registry import COMPONENT_MODEL_REGISTRY
|
|
|
|
|
|
class AmesimPnpl01ComponentTests(unittest.TestCase):
|
|
def setUp(self) -> None:
|
|
self.medium = IdealGasMedium()
|
|
|
|
def test_default_create_preserves_zero_flow_boundary_contract(self) -> None:
|
|
source = COMPONENT_MODEL_REGISTRY["amesim_pnpl01"].create(
|
|
"plug_1",
|
|
self.medium,
|
|
{},
|
|
)
|
|
|
|
self.assertIsInstance(source, AmesimPnpl01)
|
|
self.assertEqual(set(source.ports), {"port_1"})
|
|
self.assertEqual(source.parameter_values, {})
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|