Development and Testing¶
Installing for Development¶
- Clone the git repo.
virtualenv --python=python3.6 .
python setup.py develop
pip install tox
- Make changes as necessary. Run tests with
tox
.
Testing¶
Testing is done via tox and pytest. pip install tox
then tox
to run tests.
The package itself uses the wonderful requests package as a HTTP(S) client. Tests use the betamax package to record and replay HTTP(S) requests and responses. When adding a new test using betamax, set JIVEAPI_TEST_MODE=--record
in your environment to capture and record new requests - otherwise, outgoing HTTP requests will be blocked. To re-record a test, delete the current capture from tests/fixtures/cassettes
. Before committing test data, please inspect it and be sure that no sensitive information is included. To print all base64 bodies from a specific betamax “cassette”, you can use jiveapi/tests/fixtures/showcassette.py
.