def test_write_read(tmpdir): fname = os.path.join(tmpdir.strpath, "mydat") columns = bark.sampled_columns(data1) attrs = dict(sampling_rate=100, columns=columns, fluffy="cat") a = Stream(data1, attrs=attrs) a.write(fname) b = read(fname) assert eq(data1, b.call()) for key in attrs: assert attrs[key] == b.attrs[key]
def test_write(tmpdir): fname = os.path.join(tmpdir.strpath, "mydat") columns = bark.sampled_columns(data1) attrs = dict(sampling_rate=100, columns=columns, fluffy="cat") a = Stream(data1, attrs=attrs) a.write(fname) sdataset = bark.read_sampled(fname) sdata = sdataset.data assert eq(data1, sdata) sattrs = sdataset.attrs for key in attrs: assert attrs[key] == sattrs[key]