Skip to content

Commit 5e7a272

Browse files
committed
[tests] new test for OMCSessionCmd
1 parent 9a0de00 commit 5e7a272

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_OMSessionCmd.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import OMPython
2+
import unittest
3+
4+
5+
class OMCSessionCmdTester(unittest.TestCase):
6+
def __init__(self, *args, **kwargs):
7+
super(OMCSessionCmdTester, self).__init__(*args, **kwargs)
8+
9+
def test_isPackage(self):
10+
omczmq = OMPython.OMCSessionZMQ()
11+
omccmd = OMPython.OMCSessionCmd(session=omczmq)
12+
assert not omccmd.isPackage('Modelica')
13+
14+
def test_isPackage2(self):
15+
mod = OMPython.ModelicaSystem(modelName="Modelica.Electrical.Analog.Examples.CauerLowPassAnalog",
16+
lmodel=["Modelica"])
17+
omccmd = OMPython.OMCSessionCmd(session=mod.getconn)
18+
assert omccmd.isPackage('Modelica')
19+
20+
# TODO: add more checks ...
21+
22+
23+
if __name__ == '__main__':
24+
unittest.main()

0 commit comments

Comments
 (0)