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


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mockwebserver-0.5.0-py2.py3-none-any.whl (4.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3
mockwebserver-0.5.0.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page