class RedisCacheTest(TestCase): def setUp(self): self.backend = RedisCache() def test_integration(self): self.backend.set('foo', {'foo': 'bar'}, 50) result = self.backend.get('foo') assert result == {'foo': 'bar'} self.backend.delete('foo') result = self.backend.get('foo') assert result is None with self.assertRaises(ValueTooLarge): self.backend.set('foo', 'x' * (RedisCache.max_size + 1), 0)
class RedisCacheTest(TestCase): def setUp(self): self.backend = RedisCache() def test_integration(self): self.backend.set("foo", {"foo": "bar"}, 50) result = self.backend.get("foo") assert result == {"foo": "bar"} self.backend.delete("foo") result = self.backend.get("foo") assert result is None with self.assertRaises(ValueTooLarge): self.backend.set("foo", "x" * (RedisCache.max_size + 1), 0)
class RedisCacheTest(TestCase): def setUp(self): self.backend = RedisCache(hosts={0: {'db': 9}}) def test_integration(self): self.backend.set('foo', {'foo': 'bar'}, 50) result = self.backend.get('foo') assert result == {'foo': 'bar'} self.backend.delete('foo') result = self.backend.get('foo') assert result is None
class RedisCacheTest(TestCase): def setUp(self): self.backend = RedisCache() def test_integration(self): self.backend.set('foo', {'foo': 'bar'}, 50) result = self.backend.get('foo') assert result == {'foo': 'bar'} self.backend.delete('foo') result = self.backend.get('foo') assert result is None
class RedisCacheTest(TestCase): def setUp(self): self.backend = RedisCache(hosts={ 0: {'db': 9} }) def test_integration(self): self.backend.set('foo', 'bar', 50) result = self.backend.get('foo') assert result == 'bar' self.backend.delete('foo') result = self.backend.get('foo') assert result is None
def setUp(self): self.backend = RedisCache()
def setUp(self): self.backend = RedisCache(hosts={0: {'db': 9}})
def store(self): return OptionsStore(cache=RedisCache())
def setUp(self): self.backend = RedisCache(hosts={ 0: {'db': 9} })