Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Python Unit Tests



Python unit tests are used to test the behavior of Python modules. These tests use the installed version of Python 24, Python 27 or Python 3, as specified in the Configuration file. Note that you may need to change the pythonRuntime property to adapt to your Python runtime location.

For example:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <property key="pythonRuntime" value="C:/Program Files (x86)/Python24/python.exe" />
      </files>

Updating the Python library in Unit tests

Main Article: Framework development

The PythonModulesSetter Java utility class, which is present in the test directory, allows to update the Python library in all Unit Tests using these scripts after they have been modified in the Browser source.

Setting the pythonRuntime property in Unit tests

Main Article: Framework development

The pythonRuntime property can be defined in the Configuration file or in the Python module configuration.

The PythonRuntimeSetter Java utility class, which is present in the test directory, allows to update these properties depending on the Python runtimes present on the development PC. The pythonRuntime.properties properties file defines the path for the various Python runtimes, for example:
      python24=C:/Program Files (x86)/Python24/python.exe
      python27=L:/WRK/Python27/python.exe
      python35=L:/WRK/Python35/python.exe

See also


Categories: development

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence