Wiliam Souza a203d95ea9 Removed path from expectation | 9 лет назад | |
---|---|---|
docs | 9 лет назад | |
echod | 9 лет назад | |
tests | 9 лет назад | |
.coveragerc | 9 лет назад | |
.gitignore | 9 лет назад | |
.travis.yml | 9 лет назад | |
AUTHORS | 9 лет назад | |
CHANGES.md | 9 лет назад | |
Dockerfile | 9 лет назад | |
Dockerfile_dev | 9 лет назад | |
MANIFEST.in | 9 лет назад | |
Makefile | 9 лет назад | |
README.md | 9 лет назад | |
docker-compose.yml | 9 лет назад | |
docker_env | 9 лет назад | |
dot_env | 9 лет назад | |
repos.sh | 9 лет назад | |
setup.py | 9 лет назад | |
tox.ini | 9 лет назад |
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