def _create_http_client(self): return http.HTTPClient(self.endpoint, token=self.token)
def test_get_connections_kwargs_http(self): endpoint = 'http://example.com:9292' test_client = http.HTTPClient(endpoint, token=u'adc123') self.assertEqual(600.0, test_client.timeout)
def test_get_connection_class(self): endpoint = 'http://example.com:9292' test_client = http.HTTPClient(endpoint, token=u'adc123') actual = (test_client.get_connection_class('https')) self.assertEqual(http.VerifiedHTTPSConnection, actual)
def test_get_connections_kwargs_http(self): endpoint = 'http://example.com:9292' test_client = http.HTTPClient(endpoint, token=u'adc123') actual = test_client.get_connection_kwargs('http', insecure=True) self.assertEqual({'timeout': 600.0}, actual)
def __init__(self, endpoint, *args, **kwargs): """Initialize a new client for the Images v1 API.""" self.http_client = http.HTTPClient(utils.strip_version(endpoint), *args, **kwargs) self.images = images.ImageManager(self.http_client) self.image_members = image_members.ImageMemberManager(self.http_client)