Wiliam Souza c484ec7333 Updated README | 9 gadi atpakaļ | |
---|---|---|
docs | 9 gadi atpakaļ | |
echod | 9 gadi atpakaļ | |
tests | 9 gadi atpakaļ | |
.coveragerc | 9 gadi atpakaļ | |
.gitignore | 9 gadi atpakaļ | |
.travis.yml | 9 gadi atpakaļ | |
AUTHORS | 9 gadi atpakaļ | |
CHANGES.md | 9 gadi atpakaļ | |
Dockerfile | 9 gadi atpakaļ | |
Dockerfile_dev | 9 gadi atpakaļ | |
MANIFEST.in | 9 gadi atpakaļ | |
Makefile | 9 gadi atpakaļ | |
README.md | 9 gadi atpakaļ | |
docker-compose.yml | 9 gadi atpakaļ | |
docker_env | 9 gadi atpakaļ | |
dot_env | 9 gadi atpakaļ | |
repos.sh | 9 gadi atpakaļ | |
setup.py | 9 gadi atpakaļ | |
tox.ini | 9 gadi atpakaļ |
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`.
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 URL for the mock
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