

def test_string_io(self):
    df = DataFrame(np.random.randn(10, 2))
    s = df.to_msgpack(None)
    result = read_msgpack(s)
    tm.assert_frame_equal(result, df)
    s = df.to_msgpack()
    result = read_msgpack(s)
    tm.assert_frame_equal(result, df)
    s = df.to_msgpack()
    result = read_msgpack(compat.BytesIO(s))
    tm.assert_frame_equal(result, df)
    s = to_msgpack(None, df)
    result = read_msgpack(result)
    tm.assert_frame_equal(result, df)
    with ensure_clean(self.path) as p:
        s = df.to_msgpack()
        fh = open(p, 'wb')
        fh.write(s)
        fh.close()
        result = read_msgpack(p)
        tm.assert_frame_equal(result, df)

dataset/ETHPy150Open pydata/pandas/pandas/io/tests/test_packers.py TestAPI.test_string_io/VarMisuse@117/144 `s`->`result`