This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

You can use wsgitest to start a HTTP server for a WSGI application and control the process:

@Request.application
def application(request):
    return Response('Hello World!')

class AppServerTestCase(TestCase):
    def test_hello_app(self):
        server = WSGITestServer.create(application)
        try:
            response = requests.get(server.application_url)
            self.assertEqual(response.status_code, 200)
            self.assertEqual(response.content, b"Hello World!")
        finally:
            server.terminate()

    def test_hello_app_reference(self):
        server = WSGITestServer.create("tests.test_server.application")
        try:
            response = requests.get(server.application_url)
            self.assertEqual(response.status_code, 200)
            self.assertEqual(response.content, b"Hello World!")
        finally:
            server.terminate()

The method WSGITestServer.create() initialize a multiprocessing.Process and wait for the server startup.

You can use server as a context manager to avoid that tests get stucked when you forget to “terminate” server:

@Request.application
def application(request):
    return Response('Hello World!')

class AppServerTestCase(TestCase):
    def test_hello_app(self):
        with WSGITestServer(application) as server:
            response = requests.get(server.application_url)
            self.assertEqual(response.status_code, 200)
            self.assertEqual(response.content, b"Hello World!")

You can also start server with an specific host/ip or TCP port:

@Request.application
def application(request):
    return Response('Hello World!')

class AppServerTestCase(TestCase):
    def test_hello_app(self):
        with WSGITestServer(application, "0.0.0.0", 5000) as server:
            response = requests.get(server.application_url)
            self.assertEqual(response.status_code, 200)
            self.assertEqual(response.content, b"Hello World!")
Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
wsgitest-0.2.0.tar.gz (4.2 kB) Copy SHA256 Checksum SHA256 Source May 28, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting