Ejemplo n.º 1
0
def load_rdb_stream(file_name, filters=None):
    r = MockRedis()
    parser = RdbParser(r, filters)
    parser.parse_fd(
        open(os.path.join(os.path.dirname(__file__), 'dumps', file_name),
             'rb'))
    return r
Ejemplo n.º 2
0
def rdb_handler(rdb):
    print("rdb: ", rdb)
    buf = io.BytesIO()
    callback = ProtocolCallback(out=buf)
    parser = RdbParser(callback)
    mem_fd = io.BytesIO(rdb)
    parser.parse_fd(mem_fd)
    print('rdb data', buf.getvalue())
    redirect_cmd(buf.getvalue())
    print("parse rdb end")
Ejemplo n.º 3
0
def load_rdb_stream(file_name, filters=None) :
    r = MockRedis()
    parser = RdbParser(r, filters)
    parser.parse_fd(open(os.path.join(os.path.dirname(__file__), 'dumps', file_name), 'rb'))
    return r