Home | History | Annotate | Download | only in test

Lines Matching refs:httplib

1 import httplib
3 import httplib
26 raise httplib.UnimplementedFileMode()
47 This is used below to test that httplib doesn't try to read
82 conn = httplib.HTTPConnection('example.com')
106 conn = httplib.HTTPConnection('example.com')
114 conn = httplib.HTTPConnection('example.com')
122 conn = httplib.HTTPConnection('example.com')
133 conn = httplib.HTTPConnection('[2001::]:81')
141 conn = httplib.HTTPConnection('[2001:102A::]')
154 resp = httplib.HTTPResponse(sock)
161 resp = httplib.HTTPResponse(sock)
162 self.assertRaises(httplib.BadStatusLine, resp.begin)
165 exc = httplib.BadStatusLine('')
173 resp = httplib.HTTPResponse(sock)
185 resp = httplib.HTTPResponse(sock)
198 resp = httplib.HTTPResponse(sock)
209 # Note that httplib does not accept user:password@ in the host-port.
211 self.assertRaises(httplib.InvalidURL, httplib.HTTP, hp)
219 http = httplib.HTTP(hp)
239 r = httplib.HTTPResponse(s)
253 resp = httplib.HTTPResponse(sock, method="HEAD")
263 conn = httplib.HTTPConnection('example.com')
271 conn = httplib.HTTPConnection('example.com')
293 resp = httplib.HTTPResponse(sock, method="GET")
300 resp = httplib.HTTPResponse(sock, method="GET")
304 except httplib.IncompleteRead, i:
323 resp = httplib.HTTPResponse(sock, method="HEAD")
333 resp = httplib.HTTPResponse(sock, method="GET")
340 resp = httplib.HTTPResponse(sock, method="GET")
344 except httplib.IncompleteRead as i:
360 conn = httplib.HTTPConnection("example.com")
373 resp = httplib.HTTPResponse(sock)
382 resp = httplib.HTTPResponse(FakeSocket(body))
383 self.assertRaises((httplib.LineTooLong, httplib.BadStatusLine), resp.begin)
390 resp = httplib.HTTPResponse(FakeSocket(body))
391 self.assertRaises(httplib.LineTooLong, resp.begin)
401 resp = httplib.HTTPResponse(FakeSocket(body))
403 self.assertRaises(httplib.LineTooLong, resp.read)
409 resp = httplib.HTTPResponse(sock)
416 self.assertEqual(httplib.responses[httplib.NOT_FOUND], "Not Found")
435 self.conn = httplib.HTTPConnection(HOST, self.port,
440 @unittest.skipIf(not hasattr(httplib, 'HTTPSConnection'),
441 'httplib.HTTPSConnection not defined')
443 self.conn = httplib.HTTPSConnection(HOST, self.port,
470 httpConn = httplib.HTTPConnection(HOST, TimeoutTest.PORT)
481 httpConn = httplib.HTTPConnection(HOST, TimeoutTest.PORT,
490 httpConn = httplib.HTTPConnection(HOST, TimeoutTest.PORT, timeout=30)
501 if hasattr(httplib, 'HTTPSConnection'):
502 h = httplib.HTTPSConnection(HOST, TimeoutTest.PORT, timeout=30)
505 @unittest.skipIf(not hasattr(httplib, 'HTTPS'), 'httplib.HTTPS not available')
509 # Note that httplib does not accept user:password@ in the host-port.
511 self.assertRaises(httplib.InvalidURL, httplib.HTTP, hp)
519 http = httplib.HTTPS(hp)