keystone.tests.unit.common package

Submodules

keystone.tests.unit.common.test_authorization module

class keystone.tests.unit.common.test_authorization.TestTokenToAuthContext(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

test_oauth_variables_not_set()[source]
test_oauth_variables_set_for_oauth_token()[source]
test_token_is_domain_scoped()[source]
test_token_is_for_federated_user()[source]
test_token_is_not_KeystoneToken_raises_exception()[source]
test_token_is_project_scoped_with_trust()[source]
test_token_is_unscoped()[source]
test_user_id_missing_in_token_raises_exception()[source]

keystone.tests.unit.common.test_cache module

class keystone.tests.unit.common.test_cache.TestCacheRegion(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

setUp()[source]
test_combination()[source]
test_direct_region_key_invalidation()[source]

Invalidate by manually clearing the region key’s value.

NOTE(dstanek): I normally don’t like tests that repeat application logic, but in this case we need to. There are too many ways that the tests above can erroneosly pass that we need this sanity check.

test_memoize_decorator_when_invalidating_the_region()[source]
test_multi_methods_when_invalidating_the_region()[source]
test_region_multi_methods_delete()[source]
test_region_singular_methods_delete()[source]
test_singular_methods_when_invalidating_the_region()[source]

keystone.tests.unit.common.test_injection module

class keystone.tests.unit.common.test_injection.TestDependencyInjection(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

setUp()[source]
test_circular_dependency()[source]
test_dependency_consumer_configuration()[source]
test_dependency_injection()[source]
test_dependency_provider_configuration()[source]
test_get_provider()[source]
test_get_provider_not_provided_error()[source]
test_get_provider_not_provided_optional()[source]
test_inherited_dependency()[source]
test_reset()[source]
test_unresolvable_dependency()[source]

keystone.tests.unit.common.test_json_home module

class keystone.tests.unit.common.test_json_home.JsonHomeTest(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

test_build_v3_extension_parameter_relation()[source]
test_build_v3_extension_resource_relation()[source]
test_build_v3_parameter_relation()[source]
test_build_v3_resource_relation()[source]
test_translate_urls()[source]

keystone.tests.unit.common.test_manager module

class keystone.tests.unit.common.test_manager.TestCreateLegacyDriver(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

class Manager(driver)[source]

Bases: keystone.common.manager.Manager

TestCreateLegacyDriver.test_callable_passthru()[source]
TestCreateLegacyDriver.test_class_is_properly_deprecated(*args, **keywargs)[source]
TestCreateLegacyDriver.test_property_passthru()[source]

Manager delegating property call to a driver through __getattr__.

keystone.tests.unit.common.test_notifications module

exception keystone.tests.unit.common.test_notifications.ArbitraryException[source]

Bases: exceptions.Exception

class keystone.tests.unit.common.test_notifications.AuditNotificationsTestCase(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

setUp()[source]
test_resource_created_notification()[source]
test_resource_deleted_notification()[source]
test_resource_disabled_notification()[source]
test_resource_updated_notification()[source]
class keystone.tests.unit.common.test_notifications.BaseNotificationTest(*args, **kwargs)[source]

Bases: keystone.tests.unit.test_v3.RestfulTestCase

setUp()[source]
class keystone.tests.unit.common.test_notifications.CADFNotificationsDataTestCase(*args, **kwargs)[source]

Bases: keystone.tests.unit.test_v3.RestfulTestCase

setUp()[source]
test_receive_identityId_from_audit_notification()[source]
class keystone.tests.unit.common.test_notifications.CADFNotificationsForEntities(*args, **kwargs)[source]

Bases: keystone.tests.unit.common.test_notifications.NotificationsForEntities

setUp()[source]
test_initiator_data_is_set()[source]
class keystone.tests.unit.common.test_notifications.CadfNotificationsWrapperTestCase(*args, **kwargs)[source]

Bases: keystone.tests.unit.test_v3.RestfulTestCase

ACTION = 'authenticate'
LOCAL_HOST = 'localhost'
ROLE_ASSIGNMENT = 'role_assignment'
setUp()[source]
test_add_role_to_user_and_project()[source]
test_group_domain_grant()[source]
test_remove_role_from_user_and_project()[source]
test_user_project_grant()[source]
test_v3_authenticate_user_id()[source]
test_v3_authenticate_user_name_and_domain_id()[source]
test_v3_authenticate_user_name_and_domain_name()[source]
class keystone.tests.unit.common.test_notifications.NotificationsForEntities(*args, **kwargs)[source]

Bases: keystone.tests.unit.common.test_notifications.BaseNotificationTest

test_add_user_to_group()[source]
test_config_option_no_events()[source]
test_create_domain()[source]
test_create_endpoint()[source]
test_create_group()[source]
test_create_policy()[source]
test_create_project()[source]
test_create_region()[source]
test_create_role()[source]
test_create_service()[source]
test_create_trust()[source]
test_create_user()[source]
test_delete_domain()[source]
test_delete_endpoint()[source]
test_delete_group()[source]
test_delete_policy()[source]
test_delete_project()[source]
test_delete_region()[source]
test_delete_role()[source]
test_delete_service()[source]
test_delete_trust()[source]
test_delete_user()[source]
test_disable_domain()[source]
test_disable_of_disabled_domain_does_not_notify()[source]
test_disable_of_disabled_project_does_not_notify()[source]
test_disable_project()[source]
test_remove_user_from_group()[source]
test_update_domain()[source]
test_update_endpoint()[source]
test_update_group()[source]
test_update_policy()[source]
test_update_project()[source]
test_update_project_does_not_send_disable()[source]
test_update_region()[source]
test_update_role()[source]
test_update_service()[source]
test_update_user()[source]
class keystone.tests.unit.common.test_notifications.NotificationsTestCase(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

test_opt_out_authenticate_event()[source]

Test that authenticate events are successfully opted out.

test_send_audit_notification_with_opt_out()[source]

Test the private method _send_audit_notification with opt-out.

Test that _send_audit_notification does not notify when a valid notification_opt_out configuration is provided.

test_send_notification()[source]

Test _send_notification.

Test the private method _send_notification to ensure event_type, payload, and context are built and passed properly.

test_send_notification_with_opt_out()[source]

Test the private method _send_notification with opt-out.

Test that _send_notification does not notify when a valid notification_opt_out configuration is provided.

class keystone.tests.unit.common.test_notifications.TestCallbackRegistration(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

setUp()[source]
test_a_function_callback()[source]
test_a_list_of_callbacks()[source]
test_a_method_callback()[source]
test_an_invalid_callback()[source]
test_an_invalid_event()[source]
verify_log_message(data)[source]

Verify log message.

Tests that use this are a little brittle because adding more logging can break them.

TODO(dstanek): remove the need for this in a future refactoring

class keystone.tests.unit.common.test_notifications.TestEventCallbacks(*args, **kwargs)[source]

Bases: keystone.tests.unit.test_v3.RestfulTestCase

class FakeManager[source]

Bases: object

TestEventCallbacks.test_event_registration_for_unknown_resource_type()[source]
TestEventCallbacks.test_invalid_event_callbacks()[source]
TestEventCallbacks.test_invalid_event_callbacks_event()[source]
TestEventCallbacks.test_notification_event_not_valid()[source]
TestEventCallbacks.test_notification_method_not_callable()[source]
TestEventCallbacks.test_notification_received()[source]
TestEventCallbacks.test_provider_event_callback_subscription()[source]
TestEventCallbacks.test_provider_event_callbacks_subscription()[source]
TestEventCallbacks.test_using_an_unbound_method_as_a_callback_fails()[source]
class keystone.tests.unit.common.test_notifications.V2Notifications(*args, **kwargs)[source]

Bases: keystone.tests.unit.common.test_notifications.BaseNotificationTest

setUp()[source]
test_project()[source]
test_role()[source]
test_service_and_endpoint()[source]
test_user()[source]
keystone.tests.unit.common.test_notifications.register_callback(operation, resource_type='4600d355df1d49b1b4cbf6aea49a1de8')[source]

Helper for creating and registering a mock callback.

keystone.tests.unit.common.test_sql_core module

class keystone.tests.unit.common.test_sql_core.TestModel(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, keystone.common.sql.core.ModelDictMixin

id
text
class keystone.tests.unit.common.test_sql_core.TestModelDictMixin(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

test_creating_a_dict_from_a_model_instance()[source]
test_creating_a_dict_from_a_model_instance_that_has_extra_attrs()[source]
test_creating_a_model_instance_from_a_dict()[source]
test_creating_a_model_instance_from_an_invalid_dict()[source]

keystone.tests.unit.common.test_utils module

class keystone.tests.unit.common.test_utils.FernetUtilsTestCase(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

setUp()[source]
test_debug_message_logged_when_loading_fernet_token_keys()[source]
test_debug_message_not_logged_when_loading_fernet_credential_key()[source]
class keystone.tests.unit.common.test_utils.ServiceHelperTests(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

test_fail_gracefully()[source]
class keystone.tests.unit.common.test_utils.UtilsTestCase(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

OPTIONAL = <object object at 0x7fe4e5753920>
setUp()[source]
test_auth_str_equal()[source]
test_hash()[source]
test_hash_edge_cases()[source]
test_hash_long_password_strict()[source]
test_hash_long_password_truncation()[source]
test_hash_unicode()[source]
test_hash_user_password_with_empty_password()[source]
test_hash_user_password_with_null_password()[source]
test_hash_user_password_without_password()[source]
test_isotime_returns_microseconds_when_subsecond_is_true()[source]
test_isotime_returns_seconds_when_subsecond_is_false()[source]
test_isotime_rounds_microseconds_of_objects_passed_in()[source]
test_isotime_truncates_microseconds_of_objects_passed_in()[source]
test_pki_encoder()[source]
test_resource_64_char_uuid()[source]
test_resource_invalid_id()[source]
test_resource_non_ascii_chars()[source]
test_resource_uuid()[source]
test_that_a_hash_can_not_be_validated_against_a_hash()[source]
test_unixtime()[source]
test_url_safe_check()[source]
test_url_safe_with_unicode_check()[source]
test_verify_long_password_strict()[source]
test_verify_long_password_strict_raises_exception()[source]
test_verify_normal_password_strict()[source]

Module contents