-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathtest_FMIExport.py
More file actions
33 lines (28 loc) · 875 Bytes
/
test_FMIExport.py
File metadata and controls
33 lines (28 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import shutil
import os
import pathlib
import OMPython
def test_CauerLowPassAnalog():
mod = OMPython.ModelicaSystemOMC()
mod.model(
model_name="Modelica.Electrical.Analog.Examples.CauerLowPassAnalog",
libraries=["Modelica"],
)
tmp = pathlib.Path(mod.getWorkDirectory())
try:
fmu = mod.convertMo2Fmu(fileNamePrefix="CauerLowPassAnalog")
assert os.path.exists(fmu)
finally:
shutil.rmtree(tmp, ignore_errors=True)
def test_DrumBoiler():
mod = OMPython.ModelicaSystemOMC()
mod.model(
model_name="Modelica.Fluid.Examples.DrumBoiler.DrumBoiler",
libraries=["Modelica"],
)
tmp = pathlib.Path(mod.getWorkDirectory())
try:
fmu = mod.convertMo2Fmu(fileNamePrefix="DrumBoiler")
assert os.path.exists(fmu)
finally:
shutil.rmtree(tmp, ignore_errors=True)