Skip to main content

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

Project description

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.

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

mockwebserver-0.5.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

mockwebserver-0.5.0-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mockwebserver-0.5.0.tar.gz.

File metadata

  • Download URL: mockwebserver-0.5.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for mockwebserver-0.5.0.tar.gz
Algorithm Hash digest
SHA256 87e47f6467c2822b1d61c6878d950dbb3aec3ae447d7b6503f3a7abd92506d08
MD5 6a9f53362a88b0cdc32879275a01923f
BLAKE2b-256 ed997ba6bf3538d26fdbc87e4bd760d87b83645ce2a45513a0d71f9b0dd8ec47

See more details on using hashes here.

File details

Details for the file mockwebserver-0.5.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mockwebserver-0.5.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for mockwebserver-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5b1e325fc594f65090ff2b3a87067ab93b2fcfbb974ef250edbff0eeeb4014a0
MD5 ef3c5d28d734b50493906006b86256ff
BLAKE2b-256 b215f20c29617b6afac0639bc41df7a42958d7002e9786efbb92a6dbc1df0803

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page