Utilities for creating (micro)service tests. Based on Mountebank.
- Test-framework-agnostic (use unittest, nose, py.test or whatever... but I like py.test).
- Enables fast and reliable end-to-end testing of microservices. They won't be aware that they are in some testing mode.
- 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.
- Provide examples.
- Fill all imposter match fields.
- Fix all TODOs.
- If Mountebank is not found, give a clear message about installing it.
- Fully document methods.
- Translate this README to rST.
- Add to PyPI.
- Add example of calling services through client generated with Bravado.
- Remove MANIFEST.in like it's done 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.
- Bottle is used to test HTTP services' handler.