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_ldap module

class keystone.tests.unit.common.test_ldap.CommonLdapTestCase(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

These test cases call functions in keystone.common.ldap.

test_binary_attribute_values()[source]
test_user_id_and_bitmask_begins_with_0()[source]
test_user_id_and_user_name_with_boolean_string()[source]
test_user_id_begins_with_0()[source]
test_user_id_begins_with_0_and_enabled_bit_mask()[source]
test_utf8_conversion()[source]
class keystone.tests.unit.common.test_ldap.DnCompareTest(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.BaseTestCase

Tests for the DN comparison functions in keystone.common.ldap.core.

test_ava_different()[source]
test_ava_equal_complex()[source]
test_ava_equal_same()[source]
test_dn_diff_length()[source]
test_dn_equal_rdns()[source]
test_dn_equal_unicode()[source]
test_dn_parsed_dns()[source]
test_dn_same()[source]
test_prep()[source]
test_prep_insignificant()[source]
test_prep_insignificant_pre_post()[source]
test_prep_lowercase()[source]
test_rdn_attr_type_alias()[source]
test_rdn_attr_type_case_diff()[source]
test_rdn_diff_length()[source]
test_rdn_multi_ava_diff_order()[source]
test_rdn_multi_ava_diff_type()[source]
test_rdn_multi_ava_same_order()[source]
test_rdn_same()[source]
test_startswith_descendant()[source]
test_startswith_not_parent()[source]
test_startswith_parent()[source]
test_startswith_parsed_dns()[source]
test_startswith_same()[source]
test_startswith_under_child()[source]
test_startswith_unicode()[source]
class keystone.tests.unit.common.test_ldap.LDAPDeleteTreeTest(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

clear_database()[source]
config_files()[source]
config_overrides()[source]
setUp()[source]
test_delete_tree()[source]

Test manually deleting a tree.

Few LDAP servers support CONTROL_DELETETREE. This test exercises the alternate code paths in BaseLdap.delete_tree.

class keystone.tests.unit.common.test_ldap.LDAPFilterQueryCompositionTest(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

These test cases test LDAP filter generation.

setUp()[source]
test_filter_with_both_query_and_hints_set()[source]
test_filter_with_empty_query_and_hints_set()[source]
test_filter_with_hints_and_query_is_none()[source]
test_return_query_with_no_hints()[source]
class keystone.tests.unit.common.test_ldap.LDAPPagedResultsTest(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

Tests the paged results functionality in keystone.common.ldap.core.

clear_database()[source]
config_files()[source]
config_overrides()[source]
setUp()[source]
test_paged_results_control_api(*args, **keywargs)[source]
class keystone.tests.unit.common.test_ldap.MultiURLTests(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

Tests for setting multiple LDAP URLs.

test_multiple_urls_with_comma_no_conn_pool()[source]
test_multiple_urls_with_comma_with_conn_pool()[source]
class keystone.tests.unit.common.test_ldap.SslTlsTest(*args, **kwargs)[source]

Bases: keystone.tests.unit.core.TestCase

Tests for the SSL/TLS functionality in keystone.common.ldap.core.

test_certdir_trust_ldaps()[source]
test_certdir_trust_tls()[source]
test_certfile_trust_ldaps()[source]
test_certfile_trust_tls()[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

test_class_is_properly_deprecated(*args, **keywargs)[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.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

setUp()[source]
test_event_registration_for_unknown_resource_type()[source]
test_invalid_event_callbacks()[source]
test_invalid_event_callbacks_event()[source]
test_notification_event_not_valid()[source]
test_notification_method_not_callable()[source]
test_notification_received()[source]
test_provider_event_callback_subscription()[source]
test_provider_event_callbacks_subscription()[source]
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='933e87f9404a4d53be4a278d8d5d512c')[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.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 0x7f779e197ad0>
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_pki_encoder()[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