Esempio n. 1
0
    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))
Esempio n. 2
0
# 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)
Esempio n. 3
0
 def setUp(self) -> None:
     self.client = apivideo.AuthenticatedApiClient("__KEY__")
Esempio n. 4
0
 def setUp(self) -> None:
     self.client = apivideo.AuthenticatedApiClient("__KEY__")
     self.client.update_params_for_auth = lambda *x: None  # ignore auth