Skip to content

Commit 1712a85

Browse files
committed
??? fix test_FMIExport & check lmodel
1 parent 734e84b commit 1712a85

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

OMPython/ModelicaSystem.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ def __init__(
198198
if lmodel is None:
199199
lmodel = []
200200

201+
if not isinstance(lmodel, list):
202+
raise ModelicaSystemError(f"Invalid input type for lmodel: {type(lmodel)} - list expected!")
203+
201204
self.xmlFile = None
202205
self.lmodel = lmodel # may be needed if model is derived from other model
203206
self.modelName = modelName # Model class name

tests/test_FMIExport.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ def __del__(self):
1414

1515
def testCauerLowPassAnalog(self):
1616
print("testing Cauer")
17-
mod = OMPython.ModelicaSystem(modelName="Modelica.Electrical.Analog.Examples.CauerLowPassAnalog", lmodel="Modelica")
17+
mod = OMPython.ModelicaSystem(modelName="Modelica.Electrical.Analog.Examples.CauerLowPassAnalog",
18+
lmodel=["Modelica"])
1819
self.tmp = mod.getWorkDirectory()
1920

2021
fmu = mod.convertMo2Fmu(fileNamePrefix="CauerLowPassAnalog")
2122
self.assertEqual(True, os.path.exists(fmu))
2223

2324
def testDrumBoiler(self):
2425
print("testing DrumBoiler")
25-
mod = OMPython.ModelicaSystem(modelName="Modelica.Fluid.Examples.DrumBoiler.DrumBoiler", lmodel="Modelica")
26+
mod = OMPython.ModelicaSystem(modelName="Modelica.Fluid.Examples.DrumBoiler.DrumBoiler", lmodel=["Modelica"])
2627
self.tmp = mod.getWorkDirectory()
2728

2829
fmu = mod.convertMo2Fmu(fileNamePrefix="DrumBoiler")

0 commit comments

Comments
 (0)