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
()¶
-
test_get_canonical_headers_joins_all_headers
()¶
-
test_get_canonical_headers_lowercases_headers_names
()¶
-
test_get_canonical_headers_sorts_headers_lexically
()¶
-
test_get_canonical_headers_trims_header_values
()¶
-
test_get_canonical_request
()¶
-
test_get_credential_scope
()¶
-
test_get_key_to_sign_with
()¶
-
test_get_payload_hash_returns_digest_of_empty_string_for_GET_requests
()¶
-
test_get_request_params_allows_integers_as_value
()¶
-
test_get_request_params_joins_params_sorted_lexically
()¶
-
test_get_request_params_urlquotes_params_keys
()¶
-
test_get_request_params_urlquotes_params_values
()¶
-
test_get_request_params_urlquotes_params_values_allows_safe_chars_in_value
()¶
-
test_get_signature_
()¶
-
test_get_signed_headers_concats_headers_sorted_lexically
()¶
-
test_get_signed_headers_contains_all_headers_lowercased
()¶
-
test_get_string_to_sign
()¶
-
test_v4_signature
()¶
-
test_v4_signature_contains_credential_scope
()¶
-
test_v4_signature_contains_signature
()¶
-
test_v4_signature_contains_signed_headers
()¶
-
test_v4_signature_contains_user_id
()¶
-
test_v4_signature_raises_error_if_request_method_not_GET
()¶
-
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.
-
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
()¶
-
-
class
libcloud.test.common.test_google.
GoogleBaseAuthConnectionTest
(*args, **kwargs)[source]¶ Bases:
libcloud.test.common.test_google.GoogleTestCase
Tests for GoogleBaseAuthConnection
-
class
libcloud.test.common.test_google.
GoogleBaseConnectionTest
(*args, **kwargs)[source]¶ Bases:
libcloud.test.common.test_google.GoogleTestCase
Tests for GoogleBaseConnection
-
class
libcloud.test.common.test_google.
GoogleInstalledAppAuthConnectionTest
(*args, **kwargs)[source]¶ Bases:
libcloud.test.common.test_google.GoogleTestCase
Tests for GoogleInstalledAppAuthConnection
-
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'¶
libcloud.test.common.test_openstack module¶
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
()¶
-
test_retry_connection
()¶
-
libcloud.test.common.test_runabove module¶
-
class
libcloud.test.common.test_runabove.
BaseRunAboveMockHttp
(host, port, *args, **kwargs)[source]¶ Bases:
libcloud.test.MockHttp