Utilities for creating (micro)service tests. Based on Mountebank.
- Test-framework-agnostic (use unittest, nose, py.test or whatever... but I like py.test).
- Tested on Python 3.4, Ubuntu 14 x64.
- Planned features in the road map below (this is still under development).
- Install NodeJS and NPM. On Ubuntu it's
sudo apt-get install -y nodejs-legacy npm
- Install Mountebank
npm install -g mountebank --production
pip3 install git+git://github.com/butla/mountepy.git
If you want to lock on a specific version in requirements.txt then add to it a line pointing to a specific commit, e.g.:
git+git://github.com/butla/mountepy.git@456f22c
Install and run tox
pip install tox
tox
TBD
- Why Mountebank? It can be deployed as standalone application, is actively developed and supports TCP mocks which can be used to simulate broken HTTP messages.
- Why not Pretenders? Doesn't support TCP, the development doesn't seem to be active.
- Why not WireMock? I don't want to be forced to install Java to run tests and it doesn't seem to have more features than Mountebank.
- Why create a new project? There already is a Python Mountebank wrapper, but it doesn't offer much.
- Fix all TODOs
- Provide examples.
- Add to PyPI.
- Services that take configuration through environment variables. (Maybe for another project)
- This configuration can be CloudFoundry specific (VCAP_SERVICES, VCAP_APPLICATION).
- Validate if services defined in VCAP_SERVICES are in application's manifest.
- Add example of calling services through client generated with Bravado
- Remove MANIFEST.in like they did in PyScaffold.
- Requirements in setup.py should be extracted automatically from requirements.txt.
- Make Python 2.7 compatible... maybe.
- Check if cycling port_for.is_available() is as good as _wait_for_endpoint. If not, add that to port_for.