Files
deb-python-wsgi-intercept/docs/urllib3.rst
Chris Dent 57d6a28b26 Switch to using tox for testing
This allows easier testing of multiple versions of Python in a more
automated fashion. This is needed if we're ever going to make some
of the planned extensive refactorings.

This change:

* adds tox.ini
* updates Makefile and .travis.yml to point to tox
* fixes a doctest typo found while make sure the Makefile targets
  work
* adds a [docs] extras_require so that the deps in tox are managed
  cleanly

The pep8 target is currently commented out because it fails (and
has done for a long time). Will fix asap. This commit is to ensure
that travis is working. Followups will tune it up.
2016-09-22 19:00:13 +01:00

671 B

urllib3_intercept

wsgi_intercept.urllib3_intercept

Example:

import urllib3 from wsgi_intercept import urllib3_intercept, add_wsgi_intercept

pool = urllib3.PoolManager()

def app(environ, start_response):

start_response('200 OK', [('Content-Type', 'text/plain')]) return [b'Whee']

def make_app():

return app

host, port = 'localhost', 80 url = 'http://{0}:{1}/'.format(host, port) urllib3_intercept.install() add_wsgi_intercept(host, port, make_app) resp = pool.request('GET', url) assert resp.data == b'Whee' urllib3_intercept.uninstall()