Skip to content
michsmit99 edited this page Jul 30, 2014 · 9 revisions

Toolkit Unit Tests

The ACI Toolkit has a unit test suite that strives for a minimum of 100% code coverage. The test suite is contained within the acitoolkit_test.py file. Within the test suite, many of the tests are considered live tests. Live tests are those that actually communicate with an APIC and push configuration to/from the APIC. These tests can be skipped by setting the LIVE_TEST variable at the top of the file to False. The test suite covers the acitoolkit.py and acibaseobject.py files.

When adding additional code or making changes to the toolkit, please ensure that unit tests are added to cover the new functionality and that the entire test suite is run against the modified toolkit before submitting the code. Minimal code coverage can be verified using tools such as coverage.py

Toolkit CLI Application Unit Tests

The CLI application does not have formal unit tests in the same manner as the actual toolkit. It is tested separately using the command line option -t followed by a filename that contains a list of commands to be executed by the CLI. This allows code coverage tools to also run on the CLI application. A sample file named test_cli.txt is included in the toolkit that was used during development to get as much CLI test coverage as possible.

Clone this wiki locally