libcloud.test.common package
Submodules
libcloud.test.common.test_aws module
-
class
libcloud.test.common.test_aws.AWSRequestSignerAlgorithmV4TestCase(*args, **kwargs)[source]
Bases: libcloud.test.LibcloudTestCase
-
setUp()[source]
-
test_get_canonical_request()[source]
-
test_get_credential_scope()[source]
-
test_get_key_to_sign_with()[source]
-
test_get_payload_hash_returns_digest_of_empty_string_for_GET_requests()[source]
-
test_get_payload_hash_with_data_for_PUT_requests()[source]
-
test_get_payload_hash_with_empty_data_for_POST_requests()[source]
-
test_get_request_params_allows_integers_as_value()[source]
-
test_get_request_params_joins_params_sorted_lexically()[source]
-
test_get_request_params_urlquotes_params_keys()[source]
-
test_get_request_params_urlquotes_params_values()[source]
-
test_get_request_params_urlquotes_params_values_allows_safe_chars_in_value()[source]
-
test_get_signature_()[source]
-
test_get_string_to_sign()[source]
-
test_post_canonical_request()[source]
-
test_v4_signature()[source]
-
test_v4_signature_contains_credential_scope()[source]
-
test_v4_signature_contains_signature()[source]
-
test_v4_signature_contains_user_id()[source]
-
class
libcloud.test.common.test_aws.EC2MockDriver[source]
Bases: object
-
region_name = 'my_region'
libcloud.test.common.test_base_driver module
-
class
libcloud.test.common.test_base_driver.BaseDriverTestCase(methodName='runTest')[source]
Bases: unittest.case.TestCase
Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
-
test_timeout_argument_propagation_and_preservation()[source]
libcloud.test.common.test_cloudstack module
-
class
libcloud.test.common.test_cloudstack.CloudStackCommonTest(methodName='runTest')[source]
Bases: unittest.case.TestCase
Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
-
setUp()[source]
-
test_async_request_delayed()[source]
-
test_async_request_successful()[source]
-
test_async_request_unsuccessful()[source]
-
test_signature_algorithm()[source]
-
test_sync_request()[source]
-
test_sync_request_bad_response()[source]
-
class
libcloud.test.common.test_cloudstack.CloudStackMockDriver[source]
Bases: object
-
async_delay = 0
-
async_poll_frequency = 0
-
host = 'nonexistent.'
-
name = 'fake'
-
path = '/path'
-
class
libcloud.test.common.test_cloudstack.CloudStackMockHttp(*args, **kwargs)[source]
Bases: libcloud.test.MockHttpTestCase
-
ERROR_TEXT = 'ERROR TEXT'
libcloud.test.common.test_digitalocean_v1 module
libcloud.test.common.test_digitalocean_v2 module
libcloud.test.common.test_gandi module
-
class
libcloud.test.common.test_gandi.BaseGandiMockHttp(host, port, *args, **kwargs)[source]
Bases: libcloud.test.MockHttp
libcloud.test.common.test_google module
Tests for Google Connection classes.
-
class
libcloud.test.common.test_google.GoogleAuthMockHttp(host, port, *args, **kwargs)[source]
Bases: libcloud.test.MockHttp
Mock HTTP Class for Google Auth Connections.
-
json_hdr = {'content-type': 'application/json; charset=UTF-8'}
-
class
libcloud.test.common.test_google.GoogleAuthTypeTest(*args, **kwargs)[source]
Bases: libcloud.test.common.test_google.GoogleTestCase
-
test_guess()[source]
-
class
libcloud.test.common.test_google.GoogleBaseAuthConnectionTest(*args, **kwargs)[source]
Bases: libcloud.test.common.test_google.GoogleTestCase
Tests for GoogleBaseAuthConnection
-
setUp()[source]
-
test_scopes()[source]
-
test_token_request()[source]
-
class
libcloud.test.common.test_google.GoogleBaseConnectionTest(*args, **kwargs)[source]
Bases: libcloud.test.common.test_google.GoogleTestCase
Tests for GoogleBaseConnection
-
setUp()[source]
-
test_encode_data()[source]
-
test_get_poll_request_kwargs()[source]
-
test_has_completed()[source]
-
test_morph_action_hook()[source]
-
test_pre_connect_hook()[source]
-
class
libcloud.test.common.test_google.GoogleInstalledAppAuthConnectionTest(*args, **kwargs)[source]
Bases: libcloud.test.common.test_google.GoogleTestCase
Tests for GoogleInstalledAppAuthConnection
-
setUp()[source]
-
test_refresh_token()[source]
-
class
libcloud.test.common.test_google.GoogleOAuth2CredentialTest(*args, **kwargs)[source]
Bases: libcloud.test.common.test_google.GoogleTestCase
-
test_auth_connection()[source]
-
test_init_oauth2()[source]
-
test_refresh()[source]
-
class
libcloud.test.common.test_google.GoogleTestCase(*args, **kwargs)[source]
Bases: libcloud.test.LibcloudTestCase
Assists in making Google tests hermetic and deterministic.
Add anything that needs to be mocked here. Create a patcher with the
suffix ‘_patcher’.
- e.g.
- _foo_patcher = mock.patch(‘module.submodule.class.foo’, ...)
Patchers are started at setUpClass and stopped at tearDownClass.
Ideally, you should make a note in the thing being mocked, for clarity.
-
PATCHER_SUFFIX = '_patcher'
-
classmethod
setUpClass()[source]
-
classmethod
tearDownClass()[source]
-
class
libcloud.test.common.test_google.MockJsonResponse(body)[source]
Bases: object
libcloud.test.common.test_openstack module
-
class
libcloud.test.common.test_openstack.OpenStackBaseConnectionTest(methodName='runTest')[source]
Bases: unittest.case.TestCase
Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
-
setUp()[source]
-
test_base_connection_timeout()[source]
libcloud.test.common.test_openstack_identity module
libcloud.test.common.test_retry_limit module
-
class
libcloud.test.common.test_retry_limit.FailedRequestRetryTestCase(methodName='runTest')[source]
Bases: unittest.case.TestCase
Create an instance of the class that will use the named test
method when executed. Raises a ValueError if the instance does
not have a method with the specified name.
-
test_rate_limit_error(*args, **keywargs)[source]
-
test_retry_connection(*args, **keywargs)[source]
-
test_retry_connection_ssl_error(*args, **keywargs)[source]
libcloud.test.common.test_runabove module
-
class
libcloud.test.common.test_runabove.BaseRunAboveMockHttp(host, port, *args, **kwargs)[source]
Bases: libcloud.test.MockHttp
Module contents