Skip to main content

Mock Web Server

CircleCI Coverage

A simple web server for unit testing purposes. Acts as context manager for teardown.

How to develop

pip install -r requirements.txt

How to use

from mockwebserver import MockWebServer()
import requests

def test_requests_get():
    with MockWebServer() as server:
        url = server.set('/path/to/page', "page content")
        response = requests.get(url)
        assert response.ok
        assert response.text = "page content"

How to distribute

If you need to publish a new version of this package you can use this command:

$ make build
$ make dist

License

Licensed under MIT license. View license.

Release files for mockwebserver 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mockwebserver 0.5.0
File Size Uploaded
mockwebserver-0.5.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mockwebserver 0.5.0
File Interpreter ABI Platform
mockwebserver-0.5.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 7.3 kB

Release files / mockwebserver-0.5.0.tar.gz

Download URL mockwebserver-0.5.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
87e47f6467c2822b1d61c6878d950dbb3aec3ae447d7b6503f3a7abd92506d08
BLAKE2b-256 checksum
How to use checksums
ed997ba6bf3538d26fdbc87e4bd760d87b83645ce2a45513a0d71f9b0dd8ec47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

Release files / mockwebserver-0.5.0-py2.py3-none-any.whl

Download URL mockwebserver-0.5.0-py2.py3-none-any.whl
Size 4.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5b1e325fc594f65090ff2b3a87067ab93b2fcfbb974ef250edbff0eeeb4014a0
BLAKE2b-256 checksum
How to use checksums
b215f20c29617b6afac0639bc41df7a42958d7002e9786efbb92a6dbc1df0803
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page