Exemplo n.º 1
0
 def test_custom_base_url(self):
     custom_url = "https://custom.domain.com/v1/"
     with pytest.raises(dnacentersdk.exceptions.ApiError):
         dnacentersdk.DNACenterAPI(username=DNA_CENTER_USERNAME,
                                   password=DNA_CENTER_PASSWORD,
                                   encoded_auth=DNA_CENTER_ENCODED_AUTH,
                                   base_url=custom_url,
                                   verify=DEFAULT_VERIFY,
                                   version=DNA_CENTER_VERSION)
Exemplo n.º 2
0
def test_custom_base_url():
    custom_url = "https://custom.domain.com/v1/"
    connection_object = dnacentersdk.DNACenterAPI(
        username=DNA_CENTER_USERNAME,
        password=DNA_CENTER_PASSWORD,
        encoded_auth=DNA_CENTER_ENCODED_AUTH,
        base_url=custom_url,
        verify=DEFAULT_VERIFY,
        version=DNA_CENTER_VERSION)
    assert connection_object.base_url == custom_url
Exemplo n.º 3
0
def api():
    return dnacentersdk.DNACenterAPI(
        username=DNA_CENTER_USERNAME,
        password=DNA_CENTER_PASSWORD,
        encoded_auth=DNA_CENTER_ENCODED_AUTH,
        base_url=DEFAULT_BASE_URL,
        single_request_timeout=DEFAULT_SINGLE_REQUEST_TIMEOUT,
        wait_on_rate_limit=DEFAULT_WAIT_ON_RATE_LIMIT,
        verify=DEFAULT_VERIFY,
        version=DNA_CENTER_VERSION)
Exemplo n.º 4
0
 def test_non_default_wait_on_rate_limit(self, base_url):
     connection_object = dnacentersdk.DNACenterAPI(
         username=DNA_CENTER_USERNAME,
         password=DNA_CENTER_PASSWORD,
         encoded_auth=DNA_CENTER_ENCODED_AUTH,
         base_url=base_url,
         wait_on_rate_limit=not DEFAULT_WAIT_ON_RATE_LIMIT,
         verify=DEFAULT_VERIFY,
         version=DNA_CENTER_VERSION)
     assert connection_object.wait_on_rate_limit != \
         DEFAULT_WAIT_ON_RATE_LIMIT
Exemplo n.º 5
0
 def test_custom_single_request_timeout(self, base_url):
     custom_timeout = 10
     connection_object = dnacentersdk.DNACenterAPI(
         username=DNA_CENTER_USERNAME,
         password=DNA_CENTER_PASSWORD,
         encoded_auth=DNA_CENTER_ENCODED_AUTH,
         base_url=base_url,
         single_request_timeout=custom_timeout,
         verify=DEFAULT_VERIFY,
         version=DNA_CENTER_VERSION)
     assert connection_object.single_request_timeout == custom_timeout
Exemplo n.º 6
0
# -*- coding: utf-8 -*-
"""IPython Project Console.

Used to interactively work with the main package contents in IPython.
"""

import dnacentersdk

__copyright__ = "Copyright (c) 2019 Cisco and/or its affiliates."
__license__ = "MIT"

api = dnacentersdk.DNACenterAPI(verify=False)