forked from OpenModelica/OMPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_FMIExport.py
More file actions
34 lines (25 loc) · 1.06 KB
/
test_FMIExport.py
File metadata and controls
34 lines (25 loc) · 1.06 KB
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
34
import OMPython
import unittest
import shutil
import os
class testFMIExport(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(testFMIExport, self).__init__(*args, **kwargs)
self.tmp = ""
def __del__(self):
shutil.rmtree(self.tmp, ignore_errors=True)
def testCauerLowPassAnalog(self):
print("testing Cauer")
mod = OMPython.ModelicaSystem(modelName="Modelica.Electrical.Analog.Examples.CauerLowPassAnalog",
lmodel=["Modelica"])
self.tmp = mod.getWorkDirectory()
fmu = mod.convertMo2Fmu(fileNamePrefix="CauerLowPassAnalog")
self.assertEqual(True, os.path.exists(fmu))
def testDrumBoiler(self):
print("testing DrumBoiler")
mod = OMPython.ModelicaSystem(modelName="Modelica.Fluid.Examples.DrumBoiler.DrumBoiler", lmodel=["Modelica"])
self.tmp = mod.getWorkDirectory()
fmu = mod.convertMo2Fmu(fileNamePrefix="DrumBoiler")
self.assertEqual(True, os.path.exists(fmu))
if __name__ == '__main__':
unittest.main()