Esempio n. 1
0
 def _get_client_and_adapter(self, **client_kwargs):
     test_adapter = testing.MockRequestAdapter()
     client = api.Client(**client_kwargs)
     client.mount('http://', test_adapter)
     client.mount('https://', test_adapter)
     return client, test_adapter
Esempio n. 2
0
 def test_client_remembers_credentials(self):
     client = api.Client(mock.sentinel.BASE_URL, mock.sentinel.KEY_ID,
                         mock.sentinel.SHARED_SECRET)
     eq_(mock.sentinel.BASE_URL, client.base_url)
     eq_(mock.sentinel.KEY_ID, client.key_id)
     eq_(mock.sentinel.SHARED_SECRET, client.shared_secret)
Esempio n. 3
0
def test_logger_gets_reference_to_loggable_types_when_client_instantiated():
    client = api.Client("http://localhost:8080/",
                        "a85751701d4d4127a17edb34a15317a0",
                        "3b11b03d1a9f4a0ca04fdede4ae30a1c",
                        ['application/json'])
    eq_(client.api_logger.loggable_content_types, ['application/json'])