905ef41cb0
requests and urllib will get upset of socks proxy settings are present in the environment. In those interceptors, an exception will now be raised if $http_proxy or $https_proxy are set. Tests are added to cover the variable being set for all four of the interceptor types. This is the quick and dirty solution to the problem. The way this has been done shows some clear opportunities for refactoring down the road. Fixes #30 |
||
---|---|---|
docs | ||
test | ||
wsgi_intercept | ||
.gitignore | ||
.travis.yml | ||
LICENSE | ||
MANIFEST.in | ||
Makefile | ||
README | ||
README.md | ||
setup.cfg | ||
setup.py |
README.md
python3-wsgi-intercept
Python3 port of the important bits of wsgi-intercept, now working for 2.7, 3.3, 3.4 and 3.5.
Documentation is available on Read The Docs.
What is it?
wsgi_intercept installs a WSGI application in place of a real host for testing while still preserving HTTP semantics. See the PyPI page page for more details.
Modern Version
For the 2 and 3 version only some intercept functionality is provided, with a working implementation in Python 2 for:
urllib2
httplib
httplib2
requests
and in Python 3 for:
urllib.request
http.client
httplib2
requests
If you are using Python 2 and need support for a different HTTP
client, require a version of wsgi_intercept<0.6
. Another option
to keep in mind is that interceptor code from earlier versions,
such as the interceptor for mechanize
ought to work when imported
independently (see related
conversation).