New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

echod

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

echod

Echod is a mock server and a callback recorder.

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

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 WSGI HTTP Server application.
  • A Docker instance container.

Mock

.. code:: python

import echod


mock_response = {
    'status_code': 200,
    'body': {...},
}

request_contain = {
    'body': {...}
}

expectation = {
    'method': 'POST',
    'path': '/v1/users/',
    'request': request_contain,
    'response': mock_response,
}

with echod.mock(**expectation) as client:
    response = client.post()
    response.status_code == 200

callback

.. code:: python

import requests


with echod.callback() as webhook:
    settings.callback_url = webhook.url
    requests.post()
    webhook.wait_callback(timeout=10)
    webhook.response.data == {...}

.. |Build Status| image:: https://travis-ci.org/wiliamsouza/echo.svg :target: https://travis-ci.org/wiliamsouza/echo .. |Coverage Status| image:: https://coveralls.io/repos/wiliamsouza/echo/badge.svg?branch=master&service=github :target: https://coveralls.io/github/wiliamsouza/echo?branch=master

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc