Wiliam Souza a203d95ea9 Removed path from expectation | vor 9 Jahren | |
---|---|---|
docs | vor 9 Jahren | |
echod | vor 9 Jahren | |
tests | vor 9 Jahren | |
.coveragerc | vor 9 Jahren | |
.gitignore | vor 9 Jahren | |
.travis.yml | vor 9 Jahren | |
AUTHORS | vor 9 Jahren | |
CHANGES.md | vor 9 Jahren | |
Dockerfile | vor 9 Jahren | |
Dockerfile_dev | vor 9 Jahren | |
MANIFEST.in | vor 9 Jahren | |
Makefile | vor 9 Jahren | |
README.md | vor 9 Jahren | |
docker-compose.yml | vor 9 Jahren | |
docker_env | vor 9 Jahren | |
dot_env | vor 9 Jahren | |
repos.sh | vor 9 Jahren | |
setup.py | vor 9 Jahren | |
tox.ini | vor 9 Jahren |
Echod is a fully configurable mock server and an HTTP callback recorder. It is perfect to test external services.
It is easy to controlling Echod on the fly from your code or using your testing framework setup mechanism.
The main part of Echod is an HTTP server with an REST API, the Echo HTTP server have a lot of flexibility and support many start up methods.
Echod server can be run as:
echod
command line tool.from echod.mock import Mock
# This will create a mock that accepts `POST` in the path `/v1/users/`.
expectation = {
'method': 'POST',
'response': {'body': {'email': 'john@doe.com', 'name': 'John Doe'},
'headers': {'content_type': 'application/json'},
'status_code': 201}
}
with Mock(expectation) as client:
# The mock URL is available to use
client.mock_url # 'http://127.0.0.1:9876/mock/fbf01f94169640de9e585fe5e30a0958/'
# This method will make a request to the mock
response = client.response()
assert response.status_code == 201