def test_autorefresh_fail(self): responses.add('POST', '/auth/api-key', body=AUTH_RESPONSE, status=200, content_type='application/json') responses.add('POST', '/auth/refresh', body="{}", status=200, content_type='application/json') with apivideo.AuthenticatedApiClient("__KEY__") as client: time.sleep(2) with self.assertRaises(ApiAuthException): client.call_api('/test', 'GET') self.assertEqual(2, len(responses.calls))
# List all webhooks import apivideo from apivideo.apis import WebhooksApi from apivideo.exceptions import ApiAuthException api_key = "your api key here" client = apivideo.AuthenticatedApiClient(api_key) # If you'd rather use the sandbox environment: # client = apivideo.AuthenticatedApiClient(api_key, production=False) client.connect() webhooks_api = WebhooksApi(client) # Create a webhook response = webhooks_api.list() print(response)
def setUp(self) -> None: self.client = apivideo.AuthenticatedApiClient("__KEY__")
def setUp(self) -> None: self.client = apivideo.AuthenticatedApiClient("__KEY__") self.client.update_params_for_auth = lambda *x: None # ignore auth