There are two options for how to work with code
- Unit + functional tests: run_tests.sh
- Coverage Test: coverage.sh (result in htmlconv/index.html)
- All non-functional unit tests (runnable without a server) start with 'test_'
- Local (native) python (Linux or Mac)
- You'll need to pip install the following packages:
- pycurl
- pyyaml
- mock
- django==1.6.5 (for functional testing server)
- django-tastypie==0.12.1 (for functional testing server)
- discover (if on a python 2.6 system)
- Avoid a virtualenv unless you very carefully set it up for pycurl use (it may not find libcurl)
- Docker: see the docker folder, we have preconfigured images for a stable, clean verified dev/test environment
- (sudo) 'build.sh' will build docker images and verify the environment - pyresttest-build-centos6 acts as the python 2.6 / RPM-based distro environment - pyresttest-build-ubuntu-14 acts as the python 2.7 and apt-based distro environment - pyresttest-build-python3 acts as a clean testbed for work on python3 compatibility
- After building you can use them as dev environments in volumes:
- (sudo) docker run -v
pwd
:/tmp/pyresttest -it --rm pyresttest-build-centos6 /bin/bash - (sudo) docker run -vpwd
:/tmp/pyresttest -it --rm pyresttest-build-ubuntu-14 /bin/bash - OR just run the images and clone the repo from within them: 1. (sudo) docker run -it --rm pyresttest-build-ubuntu-14 /bin/bash 2. Inside container: cd /tmp && git clone https://github.com/svanoort/pyresttest.git 3. Do your coding and commit/push, etc
Release tooling requires its own special goodies. The docker images have it all baked in, for convenience's sake.
- Tar (for packaging distributions)
- For CentOS 6, rpm-build