Testing a WSGI application normally involves starting a server at a local host and port, then pointing your test code to that address. Instead, this library lets you intercept calls to any specific host/port combination and redirect them into a WSGI application importable by your test program. Thus, you can avoid spawning multiple processes or threads to test your Web app.
How Does It Work?

wsgi_intercept works by replacing httplib.HTTPConnection with a subclass, wsgi_intercept.WSGI_HTTPConnection. This class then redirects specific server/port combinations into a WSGI application by emulating a socket. If no intercept is registered for the host and port requested, those requests are passed on to the standard handler.

The functions add_wsgi_intercept(host, port, app_create_fn, script_name='') and remove_wsgi_intercept(host,port) specify which URLs should be redirect into what applications. Note especially that app_create_fn is a function object returning a WSGI application; script_name becomes SCRIPT_NAME in the WSGI app's environment, if set.
Related Documents
  1. Website Portal Testing (1835)
  2. [Free] SiteDigger : vulnerabilities, errors, configuration issues, proprietary information, and interesting security testing tool (5479)
  3. [Webinar] Are You Ready for DO-178C and Emerging Security-Critical Standards? (1369)
  4. [Video] BEZVision Performance Testing Analytics and Workloads (1621)
  5. Testing iPhone Applications (5719)
  6. [Paid] WAPT : Load and stress testing tool (1796)
  7. Performance Testing Article : Loadtester Incorporated (1338)
  8. interview questions : How to do Web Testing? (2374)
  9. Gi沼쌻 thi沼뇎 Test C沼븂g th척ng tin (Web Potal Testing) (1806)
  10. Web testing (1342)
  11. Security Strategies Alert (1002)
  12. Building web application security into your development process (1666)
  13. Security Testing for Web Application (2158)
  14. Performance Test Report Template (4118)
  15. Important Counters for Web Testing (2071)
  16. [Video] seNetsparker - A free web app security testing tool (1007)
  17. [Free] Real-time NetFlow Analyzer : Free Performance Tool (2115)
  18. [PodCast] Security Testing (104M) (1077)
  19. Web Security Testing Blog (1413)
  20. Creating a Web security testing policy (1976)