Skip to content

Commit 7c88663

Browse files
committed
??? fix tests
1 parent cb281ba commit 7c88663

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

tests/test_ModelicaSystem.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def worker():
3535
def test_setParameters(self):
3636
omc = OMPython.OMCSessionZMQ()
3737
model_path = omc.sendExpression("getInstallationDirectoryPath()") + "/share/doc/omc/testmodels/"
38-
mod = OMPython.ModelicaSystem(model_path + "BouncingBall.mo", "BouncingBall", raiseerrors=True)
38+
mod = OMPython.ModelicaSystem(model_path + "BouncingBall.mo", "BouncingBall")
3939

4040
# method 1
4141
mod.setParameters("e=1.234")
@@ -59,7 +59,7 @@ def test_setParameters(self):
5959
def test_setSimulationOptions(self):
6060
omc = OMPython.OMCSessionZMQ()
6161
model_path = omc.sendExpression("getInstallationDirectoryPath()") + "/share/doc/omc/testmodels/"
62-
mod = OMPython.ModelicaSystem(model_path + "BouncingBall.mo", "BouncingBall", raiseerrors=True)
62+
mod = OMPython.ModelicaSystem(model_path + "BouncingBall.mo", "BouncingBall")
6363

6464
# method 1
6565
mod.setSimulationOptions("stopTime=1.234")
@@ -89,7 +89,7 @@ def test_relative_path(self):
8989
model_relative = str(model_file)
9090
assert "/" not in model_relative
9191

92-
mod = OMPython.ModelicaSystem(model_relative, "M", raiseerrors=True)
92+
mod = OMPython.ModelicaSystem(model_relative, "M")
9393
assert float(mod.getParameters("a")[0]) == -1
9494
finally:
9595
# clean up the temporary file
@@ -99,8 +99,7 @@ def test_customBuildDirectory(self):
9999
filePath = (self.tmp / "M.mo").as_posix()
100100
tmpdir = self.tmp / "tmpdir1"
101101
tmpdir.mkdir()
102-
m = OMPython.ModelicaSystem(filePath, "M", raiseerrors=True,
103-
customBuildDirectory=tmpdir)
102+
m = OMPython.ModelicaSystem(filePath, "M", customBuildDirectory=tmpdir)
104103
assert pathlib.Path(m.getWorkDirectory()).resolve() == tmpdir.resolve()
105104
result_file = tmpdir / "a.mat"
106105
assert not result_file.exists()
@@ -109,7 +108,7 @@ def test_customBuildDirectory(self):
109108

110109
def test_getSolutions(self):
111110
filePath = (self.tmp / "M.mo").as_posix()
112-
mod = OMPython.ModelicaSystem(filePath, "M", raiseerrors=True)
111+
mod = OMPython.ModelicaSystem(filePath, "M")
113112
x0 = 1
114113
a = -1
115114
tau = -1 / a
@@ -145,7 +144,7 @@ def test_getters(self):
145144
y = der(x);
146145
end M_getters;
147146
""")
148-
mod = OMPython.ModelicaSystem(model_file.as_posix(), "M_getters", raiseerrors=True)
147+
mod = OMPython.ModelicaSystem(model_file.as_posix(), "M_getters")
149148

150149
q = mod.getQuantities()
151150
assert isinstance(q, list)
@@ -323,7 +322,7 @@ def test_simulate_inputs(self):
323322
y = x;
324323
end M_input;
325324
""")
326-
mod = OMPython.ModelicaSystem(model_file.as_posix(), "M_input", raiseerrors=True)
325+
mod = OMPython.ModelicaSystem(model_file.as_posix(), "M_input")
327326

328327
mod.setSimulationOptions("stopTime=1.0")
329328

tests/test_ZMQ.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def testSimulate(self):
4141
self.clean()
4242

4343
def test_execute(self):
44-
self.assertEqual('"HelloWorld!"\n', self.om.execute('"HelloWorld!"'))
44+
# self.assertEqual('"HelloWorld!"\n', self.om.execute('"HelloWorld!"'))
4545
self.assertEqual('"HelloWorld!"\n', self.om.sendExpression('"HelloWorld!"', parsed=False))
4646
self.assertEqual('HelloWorld!', self.om.sendExpression('"HelloWorld!"', parsed=True))
4747
self.clean()

tests/test_linearization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_getters(self):
6161
y2 = phi + u1;
6262
end Pendulum;
6363
""")
64-
mod = OMPython.ModelicaSystem(model_file.as_posix(), "Pendulum", ["Modelica"], raiseerrors=True)
64+
mod = OMPython.ModelicaSystem(model_file.as_posix(), "Pendulum", ["Modelica"])
6565

6666
d = mod.getLinearizationOptions()
6767
assert isinstance(d, dict)

tests/test_optimization.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def test_example(self):
4545
end BangBang2021;
4646
""")
4747

48-
mod = OMPython.ModelicaSystem(model_file.as_posix(), "BangBang2021",
49-
raiseerrors=True)
48+
mod = OMPython.ModelicaSystem(model_file.as_posix(), "BangBang2021")
5049

5150
mod.setOptimizationOptions(["numberOfIntervals=16", "stopTime=1",
5251
"stepSize=0.001", "tolerance=1e-8"])

0 commit comments

Comments
 (0)