示例#1
0
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()
示例#2
0
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()
示例#3
0
def test_direct_proxy():
    redis = RedisSpy()
    subredis = SubRedis("prefix", redis)
    subredis.pipeline("blah")
    assert redis.lastCall == "pipeline"