Ejemplo n.º 1
0
 def _create_http_client(self):
     return http.HTTPClient(self.endpoint, token=self.token)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 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)