Table Of Contents

Previous topic

3.3. How to control basic operations with Python

Next topic

3.5. How to update SEER 1.6 Agents to MAGI

This Page

3.4. How to run unittests

The unittests are best run on the operating system you will be using. By running magi_bootstrap.py, the magi software will be installed along with the tests and associated scripts. However, they can be run within the development directory as well.

3.4.1. magi_tests.py

Of the installed scripts, magi_tests.py will run the system unittests and module tests. You can skip tests with the arguments:

  • –nobase to skip system tests
  • –nomodule to skip module testse

Supplying the argument -h will provide the help description for the tests.

Before running the tests, it is advised that you stop the running magi_daemon process or some of the tests will fail.

If running in the development directory, make sure the PYTHONPATH environment variable is set to montage/backend so that eveverything is resolved correctly.

3.4.2. Test Locations

There are two paths that magi_tests will search for tests to run. The first is in the magi module itself: magi/tests/###*.py. Any files matching will be loaded and unittests run.

The second path is any modules magi/modules/*/test.py. This is where any module unittests are loaded from.