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
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file fw_http_testserver-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: fw_http_testserver-1.2.3-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/5.15.154+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 327abc939f6b3261a48026cf84c48ee5bd68c2a1ceeb43679051e4aab7b074f6 |
|
MD5 | 525d3c676fa33ce9268a671d2793902e |
|
BLAKE2b-256 | 31961853451714321278a0d6bfd346203f5fe78566d1d5958bbaeb53a1516121 |