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.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file fw_http_testserver-1.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fw_http_testserver-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 327abc939f6b3261a48026cf84c48ee5bd68c2a1ceeb43679051e4aab7b074f6
MD5 525d3c676fa33ce9268a671d2793902e
BLAKE2b-256 31961853451714321278a0d6bfd346203f5fe78566d1d5958bbaeb53a1516121

See more details on using hashes here.

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