Skip to content

Console Output

+ python2 /usr/local/bin/py.test -v --junitxml py2.xml tests
============================= test session starts ==============================
platform linux2 -- Python 2.7.17, pytest-4.6.11, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python2
cachedir: .pytest_cache
rootdir: /var/lib/jenkins1/ws/OMPython_Ticket6084
collecting ... collected 20 items

tests/test_ModelicaSystem.py::ModelicaSystemTester::testModelicaSystemLoop FAILED [  5%]
tests/test_OMParser.py::TypeCheckTester::testBoolean PASSED              [ 10%]
tests/test_OMParser.py::TypeCheckTester::testFloat PASSED                [ 15%]
tests/test_OMParser.py::TypeCheckTester::testIdent PASSED                [ 20%]
tests/test_OMParser.py::TypeCheckTester::testInt PASSED                  [ 25%]
tests/test_OMParser.py::TypeCheckTester::testNewlineBehaviour PASSED     [ 30%]
tests/test_OMParser.py::TypeCheckTester::testStr PASSED                  [ 35%]
tests/test_OMParser.py::TypeCheckTester::testUnStringable PASSED         [ 40%]
tests/test_ZMQ.py::ZMQTester::testHelloWorld PASSED                      [ 45%]
tests/test_ZMQ.py::ZMQTester::testSimulate PASSED                        [ 50%]
tests/test_ZMQ.py::ZMQTester::testTranslate PASSED                       [ 55%]
tests/test_ZMQ.py::FindBestOMCSession::testHelloWorldBestOMCSession PASSED [ 60%]
tests/test_typedParser.py::TypeCheckTester::testBoolean PASSED           [ 65%]
tests/test_typedParser.py::TypeCheckTester::testEmpty PASSED             [ 70%]
tests/test_typedParser.py::TypeCheckTester::testFloat PASSED             [ 75%]
tests/test_typedParser.py::TypeCheckTester::testIdent PASSED             [ 80%]
tests/test_typedParser.py::TypeCheckTester::testInt PASSED               [ 85%]
tests/test_typedParser.py::TypeCheckTester::testNewlineBehaviour PASSED  [ 90%]
tests/test_typedParser.py::TypeCheckTester::testStr PASSED               [ 95%]
tests/test_typedParser.py::TypeCheckTester::testUnStringable PASSED      [100%]

=================================== FAILURES ===================================
_________________ ModelicaSystemTester.testModelicaSystemLoop __________________

self = <tests.test_ModelicaSystem.ModelicaSystemTester testMethod=testModelicaSystemLoop>

    def testModelicaSystemLoop(self):
      def worker():
        origDir = os.getcwd()
        os.chdir(self.tmp)
        m = OMPython.ModelicaSystem("M.mo", "M")
        m.simulate()
        m.convertMo2Fmu(fmuType="me")
        os.chdir(origDir)
      for _ in range(10):
>       worker()

/var/lib/jenkins1/ws/OMPython_Ticket6084/tests/test_ModelicaSystem.py:29: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/var/lib/jenkins1/ws/OMPython_Ticket6084/tests/test_ModelicaSystem.py:26: in worker
    m.convertMo2Fmu(fmuType="me")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <OMPython.ModelicaSystem object at 0x7fa63d35d690>, version = '2.0'
fmuType = 'me', fileNamePrefix = '<default>', includeResources = True

    def convertMo2Fmu(self, version="2.0", fmuType="me_cs", fileNamePrefix="<default>", includeResources=True):  # 19
        """
        This method is used to generate FMU from the given Modelica model. It creates "modelName.fmu" in the current working directory. It can be called:
        with no arguments
        with arguments of https://build.openmodelica.org/Documentation/OpenModelica.Scripting.translateModelFMU.html
        usage
        >>> convertMo2Fmu()
        >>> convertMo2Fmu(version="2.0", fmuType="me|cs|me_cs", fileNamePrefix="<default>", includeResources=true)
        """
        convertMo2FmuError = ''
        if fileNamePrefix == "<default":
          fileNamePrefix = self.modelName
>       translateModelFMUResult = self.requestApi('translateModelFMU', self.modelName, fmuType, fileNamePrefix, includeResources)
E       TypeError: requestApi() takes at most 4 arguments (6 given)

/var/lib/jenkins1/ws/OMPython_Ticket6084/OMPython/__init__.py:1417: TypeError
----------------------------- Captured stdout call -----------------------------
Expected end of text, found u'-'  (at char 192), (line:1, col:193)
LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.
----------------------------- Captured stderr call -----------------------------
2020-10-30 17:15:50,057 - OMPython - INFO - OMC Server is up and running at file:////tmp/openmodelica.nobody.port.c36b533aebe541e6bd65d277b873e0a2 pid=72
------------------------------ Captured log call -------------------------------
INFO     OMPython:__init__.py:589 OMC Server is up and running at file:////tmp/openmodelica.nobody.port.c36b533aebe541e6bd65d277b873e0a2 pid=72
=============================== warnings summary ===============================
tests/test_ModelicaSystem.py::ModelicaSystemTester::testModelicaSystemLoop
tests/test_ModelicaSystem.py::ModelicaSystemTester::testModelicaSystemLoop
tests/test_ModelicaSystem.py::ModelicaSystemTester::testModelicaSystemLoop
  /var/lib/jenkins1/ws/OMPython_Ticket6084/OMPython/__init__.py:815: DeprecationWarning: This method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.
    ch = sv.getchildren()

-- Docs: https://docs.pytest.org/en/latest/warnings.html
----- generated xml file: /var/lib/jenkins1/ws/OMPython_Ticket6084/py2.xml -----
=============== 1 failed, 19 passed, 3 warnings in 3.28 seconds ================