================
This is a simple HTTP server that will respond to a single HTTP request and
record some of the data. It is still an early version and doesn't do
everything you probably want.
[](http://travis-ci.org/philipcristiano/testhttpserver)
Installing
==========
pip install testhttpserver
Using in your tests
===================
To create a test server import the server
from testhttpserver import Server
And then create a new instance including the port, response status and
content.
server = Server(8000, response_status=200, response_content='Content')
After you make your request to http://localhost:8000/ . If you POST to the
server it will have ``request_headers``, ``request_content``, and
``request_path`` available.
When you are done remember to ``join()``!
server.join()
See ``tests/test_server.py`` for an example!
Server Parameters
================
port - The port the server will listen on
response_status - int of the status to return
response_content - string of content to return
response_headers - a list of tuples to return as headers
timeout - number of seconds before the server timesout and returns
Metadata
Release files for testhttpserver 0.1.4
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 |
|---|---|---|---|---|
| testhttpserver-0.1.4.tar.gz | 2.6 kB | Without provenance | Details for testhttpserver-0.1.4.tar.gz |
Release files / testhttpserver-0.1.4.tar.gz
| Download URL | testhttpserver-0.1.4.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4f535f0f8552aa0ca63df34519234c64273d431a51f31297cf113a0de770caf
|
|
BLAKE2b-256 checksum How to use checksums |
80b3a435c18f1643cc9cf751260a16572a438779f16a029f836138eb616d7256
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for testhttpserver 0.1.4
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.