Skip to main content

Server to test HTTP clients

Project description

HTTP Server to test HTTP clients.


pip install test-server

Usage Example


from unittest import TestCase
    from urllib import urlopen
except ImportError:
    from urllib.request import urlopen
from test_server import TestServer

class UrllibTestCase(TestCase):
    def setUpClass(cls):
        cls.server = TestServer()

    def tearDownClass(cls):

    def setUp(self):

    def test_get(self):
        token = b'zorro'
        self.server.response['data'] = token
        data = urlopen(self.server.base_url).read()
        self.assertEqual(data, token)

Download files

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

Files for test-server, version 0.0.31
Filename, size File type Python version Upload date Hashes
Filename, size test-server-0.0.31.tar.gz (9.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page