-
Notifications
You must be signed in to change notification settings - Fork 24
Testsuite
There are two main sets of tests:
- Functional tests (in tests/functional)
- These are mainly internal I/O tests, checking that the classes and most of the methods are behaving as expected, and that convenience methods and the like work correctly. These do not need to have access to an external SWORD v2 compliant server and so do not test the HTTP communication methods directly.
- These tests can be run using 'nose' as follows:
nosetests tests/functional
- HTTP tests (in tests/http)
- These test the various SWORD2 HTTP requests with an external SWORD v2 server. Currenly, the testsuite requires an instance of the [http://sword-app.svn.sourceforge.net/viewvc/sword-app/sss/trunk/](Simple Sword Server) running locally to test against.
- These can be run using 'nose' as follows:
nosetests tests/http
Note that this will attempt to download the latest Simple Sword Server (sss.py) from the sword-app subversion repository. Currently, this script requires python-lxml to be installed in the python environment.
[http://tox.readthedocs.org/en/latest/?redir]((See here for information about tox))
"tox aims to automate state-of-the-art packaging, testing and deployment of Python software right from your console or CI server, invoking your tools of choice."
Tox is a very useful tool when combined with a Continuous Integration server, such as Jenkins. To use this, simple run 'tox' within the working directory.
[http://readthedocs.org/docs/tox/en/latest/example/jenkins.html](Information about configuring Jenkins and Tox to work together)
(NB that documentation assumes you are using pytest. If, like this project, you wish to use nose
to run your testsuite, but want Jenkins integration then:
In tox.ini:
...
dep = ....
nose
# Remember to add nose to the tox dependancies list.
command=nosetests {TEST LOCATION] --with-xunit
The key addition is --with-xunit
. This will create a JUnit-compatible log file of the tests in 'nosetests.xml' in the working directory. Point to this in the "Publish JUnit test result report" option.
Currently, due to an awkward lxml dependancy of the sss.py, only the functional tests are run by tox.ini, as the dependancy refuses to build for me...