38 lines
843 B
Python
38 lines
843 B
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from app.simulation.components.amesim.flow.orifices import AmesimPnvo001FixedOpening
|
|
from app.simulation.components.amesim.media.mediums import (
|
|
AmesimHeliumPengRobinsonMedium,
|
|
)
|
|
from app.simulation.core.medium import IdealGasMedium
|
|
from app.simulation.registry import COMPONENT_MODEL_REGISTRY
|
|
|
|
|
|
class AmesimPnvo001FixedOpeningComponentTests(unittest.TestCase):
|
|
def setUp(self) -> None:
|
|
self.medium = IdealGasMedium()
|
|
|
|
|
|
def test_rejects_fractional_flowset(self) -> None:
|
|
with self.assertRaisesRegex(ValueError, "must be one of"):
|
|
COMPONENT_MODEL_REGISTRY["amesim_pnvo001_fixed"].create(
|
|
"valve_1",
|
|
self.medium,
|
|
{"flowset": 1.5},
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|