def setUp(self): TestCase.setUp(self) fixture_name = "test_urllib2_localnet_ProxyAuthTests_server" self.register_context_manager(fixture_name, testprogram.ServerCM(self._make_server)) server = self.get_cached_fixture(fixture_name) proxy_url = "http://127.0.0.1:%d" % server.port handler = mechanize.ProxyHandler({"http": proxy_url}) self.proxy_digest_handler = mechanize.ProxyDigestAuthHandler() self.opener = mechanize.build_opener(handler, self.proxy_digest_handler)
def setUp(self): TestCase.setUp(self) self.register_context_manager( self.fixture_name, testprogram.ServerCM(make_started_server))