def setUp(self): super(CacheBaseTest, self).setUp() self.client = cache.get_cache(self.cache_url)
def test_get_cache(self): driver = cache.get_cache() self.assertIsInstance(driver, memory.MemoryBackend)
def test_get_cache_options(self): driver = cache.get_cache('memory://?default_ttl=4') self.assertIsInstance(driver, memory.MemoryBackend) self.assertEqual(driver._options, {'default_ttl': '4'}) self.assertEqual(driver._default_ttl, 4)
def test_oslo_config(self): conf = cfg.ConfigOpts() cache.register_oslo_configs(conf) driver = cache.get_cache(conf.cache_url) self.assertIsInstance(driver, memory.MemoryBackend)