def test_get_from_pipeline(): subredis = SubRedis("prefix", r) subredis.set("foo", "bar") subredis.set("shaz", "snaz") pipeline = subredis.pipeline() pipeline.get("foo") pipeline.get("shaz") result = pipeline.execute() result = [x.decode('utf-8') for x in result] assert result == ["bar", "snaz"] subredis.flushdb()
def test_direct_proxy(): redis = RedisSpy() subredis = SubRedis("prefix", redis) subredis.pipeline("blah") assert redis.lastCall == "pipeline"