diff options
author | DUVAL Thomas <thomas.duval@orange.com> | 2016-06-09 09:11:50 +0200 |
---|---|---|
committer | DUVAL Thomas <thomas.duval@orange.com> | 2016-06-09 09:11:50 +0200 |
commit | 2e7b4f2027a1147ca28301e4f88adf8274b39a1f (patch) | |
tree | 8b8d94001ebe6cc34106cf813b538911a8d66d9a /keystone-moon/keystone/tests/unit/ksfixtures/cache.py | |
parent | a33bdcb627102a01244630a54cb4b5066b385a6a (diff) |
Update Keystone core to Mitaka.
Change-Id: Ia10d6add16f4a9d25d1f42d420661c46332e69db
Diffstat (limited to 'keystone-moon/keystone/tests/unit/ksfixtures/cache.py')
-rw-r--r-- | keystone-moon/keystone/tests/unit/ksfixtures/cache.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/keystone-moon/keystone/tests/unit/ksfixtures/cache.py b/keystone-moon/keystone/tests/unit/ksfixtures/cache.py index 74566f1e..e0833ae2 100644 --- a/keystone-moon/keystone/tests/unit/ksfixtures/cache.py +++ b/keystone-moon/keystone/tests/unit/ksfixtures/cache.py @@ -13,11 +13,17 @@ import fixtures +from keystone import catalog from keystone.common import cache +CACHE_REGIONS = (cache.CACHE_REGION, catalog.COMPUTED_CATALOG_REGION) + + class Cache(fixtures.Fixture): - """A fixture for setting up and tearing down the cache between test cases. + """A fixture for setting up the cache between test cases. + + This will also tear down an existing cache if one is already configured. """ def setUp(self): @@ -29,8 +35,9 @@ class Cache(fixtures.Fixture): # NOTE(morganfainberg): The only way to reconfigure the CacheRegion # object on each setUp() call is to remove the .backend property. - if cache.REGION.is_configured: - del cache.REGION.backend + for region in CACHE_REGIONS: + if region.is_configured: + del region.backend - # ensure the cache region instance is setup - cache.configure_cache_region(cache.REGION) + # ensure the cache region instance is setup + cache.configure_cache(region=region) |