oslo_cache.tests package

oslo_cache.tests package

Submodules

oslo_cache.tests.test_cache module

class oslo_cache.tests.test_cache.BaseTestCase(*args, **kwds)

Bases: oslotest.base.BaseTestCase

setUp()
class oslo_cache.tests.test_cache.CacheRegionTest(*args, **kwds)

Bases: oslo_cache.tests.test_cache.BaseTestCase

setUp()
test_cache_debug_proxy()
test_cache_dictionary_config_builder()

Validate we build a sane dogpile.cache dictionary config.

test_cache_dictionary_config_builder_global_disabled()

Validate the backend is reset to default if caching is disabled.

test_cache_fallthrough_expiration_time_fn()
test_cache_no_fallthrough_expiration_time_fn()
test_cache_region_no_error_multiple_config()
test_configure_non_region_object_raises_error()
test_function_key_generator_with_kwargs()
test_kwarg_function_key_generator_no_kwargs()
test_kwarg_function_key_generator_with_kwargs()
test_region_built_with_proxy_direct_cache_test()
test_should_cache_fn_global_cache_disabled()
test_should_cache_fn_global_cache_disabled_group_cache_enabled()
test_should_cache_fn_global_cache_enabled()
test_should_cache_fn_global_cache_enabled_group_cache_disabled()
test_should_cache_fn_global_cache_enabled_group_cache_enabled()
class oslo_cache.tests.test_cache.TestProxy(*args, **kwargs)

Bases: dogpile.cache.proxy.ProxyBackend

get(key)
class oslo_cache.tests.test_cache.TestProxyValue(value)

Bases: object

class oslo_cache.tests.test_cache.UTF8KeyManglerTests(*args, **kwds)

Bases: oslo_cache.tests.test_cache.BaseTestCase

test_key_is_bytestring()
test_key_is_string()
test_key_is_utf8_encoded()

oslo_cache.tests.test_cache_backend_mongo module

class oslo_cache.tests.test_cache_backend_mongo.MockCollection(db, name)

Bases: object

ensure_index(key_or_list, *args, **kwargs)
find(spec=None, *args, **kwargs)
find_and_modify(spec, document, upsert=False, **kwargs)
find_one(spec_or_id=None, *args, **kwargs)
index_information()
insert(data, manipulate=True, **kwargs)
remove(spec_or_id=None, search_filter=None)

Remove objects matching spec_or_id from the collection.

save(data, manipulate=True, **kwargs)
update(spec, document, upsert=False, **kwargs)
class oslo_cache.tests.test_cache_backend_mongo.MockCursor(collection, dataset_factory)

Bases: object

next()
class oslo_cache.tests.test_cache_backend_mongo.MockMongoClient(*args, **kwargs)

Bases: object

class oslo_cache.tests.test_cache_backend_mongo.MockMongoDB(dbname)

Bases: object

add_son_manipulator(manipulator)
authenticate(username, password)
class oslo_cache.tests.test_cache_backend_mongo.MongoCache(*args, **kwds)

Bases: oslo_cache.tests.test_cache.BaseTestCase

setUp()
test_additional_crud_method_arguments_support()

Additional arguments should works across find/insert/update.

test_backend_delete_data()
test_backend_get_missing_data()
test_backend_multi_delete_data()
test_backend_multi_get_data()
test_backend_multi_set_data()
test_backend_multi_set_get_with_blanks_none()
test_backend_multi_set_should_update_existing()
test_backend_set_blank_as_data()
test_backend_set_data()
test_backend_set_data_with_int_as_valid_ttl()
test_backend_set_data_with_string_as_valid_ttl()
test_backend_set_none_as_data()
test_backend_set_same_key_multiple_times()
test_cache_configuration_values_assertion()
test_correct_read_preference()
test_correct_write_concern()
test_incorrect_mongo_ttl_seconds()
test_incorrect_read_preference()
test_incorrect_write_concern()
test_missing_cache_collection_name()
test_missing_db_hosts()
test_missing_db_name()
test_missing_replica_set_name()
test_multiple_region_cache_configuration()
test_provided_replica_set_name()
test_typical_configuration()
class oslo_cache.tests.test_cache_backend_mongo.MyTransformer

Bases: oslo_cache.backends.mongo.BaseTransform

Added here just to check manipulator logic is used correctly.

transform_incoming(son, collection)
transform_outgoing(son, collection)
oslo_cache.tests.test_cache_backend_mongo.get_collection(db_name, collection_name)
oslo_cache.tests.test_cache_backend_mongo.pymongo_override()

oslo_cache.tests.test_connection_pool module

class oslo_cache.tests.test_connection_pool.TestConnectionPool(*args, **kwds)

Bases: oslo_cache.tests.test_cache.BaseTestCase

cleanup_instance(*names)

Create a function suitable for use with self.addCleanup.

Returns:a callable that uses a closure to delete instance attributes
setUp()
test_acquire_conn_exception_returns_acquired_count()
test_cleanup_pool()
test_connection_pool_limits_maximum_connections()
test_connection_pool_maximum_connection_get_timeout()
test_get_context_manager()
class oslo_cache.tests.test_connection_pool.TestMemcacheClientOverrides(*args, **kwds)

Bases: oslo_cache.tests.test_cache.BaseTestCase

test_client_stripped_of_threading_local()

threading.local overrides are restored for _MemcacheClient

oslo_cache.tests.test_dict_backend module

class oslo_cache.tests.test_dict_backend.CacheDictBackendTest(*args, **kwds)

Bases: oslo_cache.tests.test_cache.BaseTestCase

setUp()
test_dict_backend()
test_dict_backend_clear_cache()
test_dict_backend_expiration_time()
test_dict_backend_multi_keys()
test_dict_backend_multi_keys_in_one_call()
test_dict_backend_rewrite_value()
test_dict_backend_zero_expiration_time()

Module contents

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.