def setUp(self): # Install the intercept from wsgi_intercept import httplib_intercept httplib_intercept.install() # Add the intercept for a nonexistant domain self.domain = "some_hopefully_nonexistant_domain" wsgi_intercept.add_intercept(self.domain, self.port, testing.create_fn) self.addCleanup(wsgi_intercept.remove_intercept, self.domain, self.port) # Cleanup with an intercept uninstall self.addCleanup(httplib_intercept.uninstall)
def setUp(self): # Install the intercept from wsgi_intercept import httplib_intercept httplib_intercept.install() # Add the intercept for a nonexistant domain self.domain = 'some_hopefully_nonexistant_domain' wsgi_intercept.add_intercept(self.domain, self.port, testing.create_fn) self.addCleanup(wsgi_intercept.remove_intercept, self.domain, self.port) # Cleanup with an intercept uninstall self.addCleanup(httplib_intercept.uninstall)
def setUp(self): import wsgi_intercept wsgi_intercept.add_intercept(self.domain, self.port, self.wsgi_app) self.addCleanup(wsgi_intercept.remove_intercept, self.domain, self.port)