Skip to main content

HTTP test server for mocking services

Project description

fw-http-testserver

HTTP test server for stubbing / mocking 3rd party services.

Installation

Add as a poetry dev dependency to your project:

poetry add --dev fw-http-testserver

Usage

import requests
pytest_plugins = "fw_http_testserver"

def test_my_app(http_testserver):
    http_testserver.add_response("/path", {"foo": "bar"})
    resp = requests.get(f"{http_testserver.url}/path")
    assert resp.json() == {"foo": "bar"}

Development

Install the project using poetry and enable pre-commit:

poetry install
pre-commit install

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

fw_http_testserver-1.2.2-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page