Home | History | Annotate | Download | only in test

Lines Matching refs:urllib2

8 import urllib2
9 from urllib2 import Request, OpenerDirector
20 self.assertRaises(ValueError, urllib2.urlopen, 'bogus url')
23 fname = os.path.abspath(urllib2.__file__).replace('\\', '/')
37 f = urllib2.urlopen(file_url)
48 self.assertEqual(urllib2.parse_http_list(string), list)
60 code that previously saw all (urllib2 user)-provided headers in .headers
85 normalization to .title()-case is done by urllib2 before sending headers to
116 >>> mgr = urllib2.HTTPPasswordMgr()
181 >>> mgr = urllib2.HTTPPasswordMgr()
347 raise urllib2.URLError("blah")
396 class MockHTTPHandler(urllib2.BaseHandler):
422 class MockHTTPSHandler(urllib2.AbstractHTTPHandler):
427 urllib2.AbstractHTTPHandler.__init__(self)
462 from urllib2 import URLError
470 o.add_handler(urllib2.UnknownHandler())
528 self.assertRaises(urllib2.URLError, o.open, req)
616 class NullFTPHandler(urllib2.FTPHandler):
668 h = urllib2.FileHandler()
726 self.assertRaises(urllib2.URLError,
731 h = urllib2.FileHandler()
752 except (urllib2.URLError, OSError):
761 h = urllib2.AbstractHTTPHandler()
791 self.assertRaises(urllib2.URLError, h.do_open, http, req)
824 h = urllib2.AbstractHTTPHandler()
848 # Issue4493: urllib2 to supply '/' when to urls where path does not
851 h = urllib2.AbstractHTTPHandler()
867 h = urllib2.HTTPErrorProcessor()
893 h = urllib2.HTTPCookieProcessor(cj)
909 h = urllib2.HTTPRedirectHandler()
925 except urllib2.HTTPError:
962 except urllib2.HTTPError:
964 self.assertEqual(count, urllib2.HTTPRedirectHandler.max_repeats)
974 except urllib2.HTTPError:
976 urllib2.HTTPRedirectHandler.max_redirections)
983 h = urllib2.HTTPRedirectHandler()
990 self.assertRaises(urllib2.HTTPError, h.http_error_302,
1009 hdeh = urllib2.HTTPDefaultErrorHandler()
1010 hrh = urllib2.HTTPRedirectHandler()
1011 cp = urllib2.HTTPCookieProcessor(cj)
1019 hdeh = urllib2.HTTPDefaultErrorHandler()
1020 hrh = urllib2.HTTPRedirectHandler()
1027 ph = urllib2.ProxyHandler(dict(http="proxy.example.com:3128"))
1045 ph = urllib2.ProxyHandler(dict(http="proxy.example.com"))
1060 ph = urllib2.ProxyHandler(dict(https='proxy.example.com:3128'))
1075 ph = urllib2.ProxyHandler(dict(https='proxy.example.com:3128'))
1099 auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
1118 auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
1135 ph = urllib2.ProxyHandler(dict(http="proxy.example.com:3128"))
1138 auth_handler = urllib2.ProxyBasicAuthHandler(password_manager)
1165 class TestDigestAuthHandler(urllib2.HTTPDigestAuthHandler):
1168 urllib2.HTTPDigestAuthHandler.http_error_401(self,
1170 class TestBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
1173 urllib2.HTTPBasicAuthHandler.http_error_401(self,
1236 class MyHTTPHandler(urllib2.HTTPHandler): pass
1237 class FooHandler(urllib2.BaseHandler):
1239 class BarHandler(urllib2.BaseHandler):
1242 build_opener = urllib2.build_opener
1260 self.opener_has_handler(o, urllib2.HTTPHandler)
1261 o = build_opener(urllib2.HTTPHandler)
1262 self.opener_has_handler(o, urllib2.HTTPHandler)
1263 o = build_opener(urllib2.HTTPHandler())
1264 self.opener_has_handler(o, urllib2.HTTPHandler)
1267 class MyOtherHTTPHandler(urllib2.HTTPHandler): pass
1282 self.get = urllib2.Request("http://www.python.org/~jeremy/")
1283 self.post = urllib2.Request("http://www.python.org/~jeremy/",
1304 req = urllib2.Request("http://www.python.org/")
1314 req = urllib2.Request("http://www.%70ython.org/")
1335 url = 'http://docs.python.org/library/urllib2.html#OK'
1344 >>> err = urllib2.HTTPError(msg='something bad happened', url=None, code=None, hdrs=None, fp=None)
1354 err = urllib2.HTTPError(msg='something bad happened', url=None,
1369 test_support.run_doctest(urllib2, verbose)