def test_redis_pickle_roundtrip(self): backend = 'redis://localhost:6379/0' r = RedisBackend('redis_experiment', backend) obj = dict(a=1, b=2) r.save_object('redis_experiment:obj', obj) res = r.load_object('redis_experiment:obj') assert res == obj obj = dict(a=pd.Timestamp('2011-01-01'), b=[1, 2, 4]) r.save_object('redis_experiment:obj', obj) res = r.load_object('redis_experiment:obj') assert res == obj
def teardown_class(cls): from daskperiment.backend import RedisBackend RedisBackend('remove_all', cls.backend)._delete_cache()
def init_backend(cls): uri = 'redis://localhost:6379/0' return RedisBackend('redis_backend', uri)
def test_redis_backend_picklable(self): backend = 'redis://localhost:6379/0' r = RedisBackend('redis_experiment', backend) res = pickle.loads(pickle.dumps(r)) assert r == res assert res.uri == backend