A HTTP server to use for testing
Project description
Test HTTP Server
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.
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 post_headers and post_content available.
When you are done remember to join()!
server.join()
See tests/test_server.py for an example!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file testhttpserver-0.1.0.tar.gz
.
File metadata
- Download URL: testhttpserver-0.1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fa6c29e0969d20c2f804972ba222309cdfc57991ae832622bbaef6a8bed68a1 |
|
MD5 | 71cb91786cdf74f0b33a26c04ba54b61 |
|
BLAKE2b-256 | 3b814d53e1b968c9c14c9f25f8109975bbf446c17ee5dcac14cf07e01ad3fb19 |