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_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='43ee6279e3964623b5c7a5181e3e760d')[source]
Helper for creating and registering a mock callback.
keystone.tests.unit.common.test_utils module
Module contents