Sen descrición

Wiliam Souza c484ec7333 Updated README %!s(int64=8) %!d(string=hai) anos
docs a4b6f108b3 Remane to echod to avoid conflict %!s(int64=8) %!d(string=hai) anos
echod a203d95ea9 Removed path from expectation %!s(int64=8) %!d(string=hai) anos
tests 8da70e6a3c Skyp bug test %!s(int64=8) %!d(string=hai) anos
.coveragerc 3001ddb742 Updated coveragerc %!s(int64=8) %!d(string=hai) anos
.gitignore af3981b1c8 Rename to echod %!s(int64=8) %!d(string=hai) anos
.travis.yml ac79cd3cbc Update pytest-asyncio and remove workaround to it work %!s(int64=8) %!d(string=hai) anos
AUTHORS 4651521daa Add project basic files %!s(int64=9) %!d(string=hai) anos
CHANGES.md 2f4db3f1a6 Add tox and version commands to setup %!s(int64=8) %!d(string=hai) anos
Dockerfile af3981b1c8 Rename to echod %!s(int64=8) %!d(string=hai) anos
Dockerfile_dev b269fff8f7 Add wheel and twine to dev requires, fix setup version and rst and docker to Makefile %!s(int64=8) %!d(string=hai) anos
MANIFEST.in ad2c3c4209 Add docs and tox commands %!s(int64=8) %!d(string=hai) anos
Makefile b269fff8f7 Add wheel and twine to dev requires, fix setup version and rst and docker to Makefile %!s(int64=8) %!d(string=hai) anos
README.md c484ec7333 Updated README %!s(int64=8) %!d(string=hai) anos
docker-compose.yml af3981b1c8 Rename to echod %!s(int64=8) %!d(string=hai) anos
docker_env af3981b1c8 Rename to echod %!s(int64=8) %!d(string=hai) anos
dot_env af3981b1c8 Rename to echod %!s(int64=8) %!d(string=hai) anos
repos.sh 4651521daa Add project basic files %!s(int64=9) %!d(string=hai) anos
setup.py 28d5730527 Add not found test %!s(int64=8) %!d(string=hai) anos
tox.ini ac79cd3cbc Update pytest-asyncio and remove workaround to it work %!s(int64=8) %!d(string=hai) anos

README.md

echod

Build Status Coverage Status

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:

  • A standalone using echod command line tool.
  • A Docker instance container.

Mock

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