http-server-mock
http-server-mock is a HTTP Server Mock using Flask. You can use it to test possible integrations with your application.
http-server-mock is available on PyPI. To install it just run:
pip install http-server-mock
Using http-server-mock is similar to implement any Flask application.
from http_server_mock import HttpServerMock
import requests
app = HttpServerMock(__name__)
@app.route("/", methods=["GET"])
def index():
return "Hello world"
with app.run("localhost", 5000):
r = requests.get("http://localhost:5000/")
# r.status_code == 200
# r.text == "Hello world"
HttpServerMock will use a random route to know if the http server is running, if you want to set a specific route to do it just set the parameter is_alive_route:
from http_server_mock import HttpServerMock
app = HttpServerMock(__name__, is_alive_route="/is-alive")
Metadata
Release files for http-server-mock 1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| http_server_mock-1.7.tar.gz | 15.3 kB | Without provenance | Details for http_server_mock-1.7.tar.gz |
Release files / http_server_mock-1.7.tar.gz
| Download URL | http_server_mock-1.7.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a53986042414bb95506e2b486e7ab27e6ea0889160cdff794b5004ee79313907
|
|
BLAKE2b-256 checksum How to use checksums |
a0f30b7d7d8643f52a1b38a11906636ad7e6162954b71fb200ecaac430fffc8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.10.0 pkginfo/1.2.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.8.0 tqdm/4.46.1 CPython/3.6.9
|
Security for http-server-mock 1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.