Unit Testing

Since release 2017.0201.0, this project relies on the Python unittest [1] package to apply unit testing [2] to the source code. The test code is in the tests directory. Various tests have been developed starting with the 2017.0201.0 release to provide features or resolve problems reported. The tests are not yet exhaustive yet the reported code coverage [3] is well over 80%.

The unit tests are implemented in a standard manner such that independent review [4] can run the tests on this code based on the instructions provided in a .travis.yml configuration file in the project directory.

This command will run the unit tests locally:

python tests

Additional information may be learned with a Python package to run the tests:

coverage run -a tests && coverage report -m

The coverage command ([5]), will run the tests and then prepare a report of the percentage of the Python source code that has been executed during the unit tests.


The number of lines reported by coverage may differ from that reported by travis-ci. The primary reason is that certain tests involving access to information from GitHub may succeed or not depending on the “Github API rate limit”. [6]

[1]Python unittest package: https://docs.python.org/2/library/unittest.html
[2]unit testing: https://en.wikipedia.org/wiki/Unit_testing
[3]coveralls code coverage: https://coveralls.io/github/prjemian/spec2nexus
[4]travis-ci continuous intregration: https://travis-ci.org/prjemian/spec2nexus
[5]coverage: https://coverage.readthedocs.io
[6]Github API rate limit: https://developer.github.com/v3/rate_limit/