Skip to content

Console Output

+ python3 /usr/local/bin/py.test -v --junitxml py3.xml tests
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-6.1.2, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3
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 0x7fb470ffe208>, 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 from 2 to 4 positional arguments but 6 were given

/var/lib/jenkins1/ws/OMPython_Ticket6084/OMPython/__init__.py:1417: TypeError
----------------------------- Captured stdout call -----------------------------
Expected end of text, found '-'  (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:49,684 - OMPython - INFO - OMC Server is up and running at file:////tmp/openmodelica.nobody.port.ca7151f2815e4fb2ba6183f4ecc48c76 pid=63
------------------------------ Captured log call -------------------------------
INFO     OMPython:__init__.py:589 OMC Server is up and running at file:////tmp/openmodelica.nobody.port.ca7151f2815e4fb2ba6183f4ecc48c76 pid=63
=============================== warnings summary ===============================
OMPython/__init__.py:649
  /var/lib/jenkins1/ws/OMPython_Ticket6084/OMPython/__init__.py:649: DeprecationWarning: invalid escape sequence \O
    """

-- Docs: https://docs.pytest.org/en/stable/warnings.html
----- generated xml file: /var/lib/jenkins1/ws/OMPython_Ticket6084/py3.xml -----
=========================== short test summary info ============================
FAILED tests/test_ModelicaSystem.py::ModelicaSystemTester::testModelicaSystemLoop
=================== 1 failed, 19 passed, 1 warning in 2.64s ====================