def test_bytes_io(): """ Test bti bytes-io API """ for pdf, config, hs in zip(pdf_fnames, config_fnames, hs_fnames): raw = read_raw_bti(pdf, config, hs, convert=True) with open(pdf, 'rb') as fid: pdf = six.BytesIO(fid.read()) with open(config, 'rb') as fid: config = six.BytesIO(fid.read()) with open(hs, 'rb') as fid: hs = six.BytesIO(fid.read()) raw2 = read_raw_bti(pdf, config, hs, convert=True) repr(raw2) assert_array_equal(raw._data, raw2._data)
def test_bytes_io(): """ Test bti bytes-io API """ for pdf, config, hs in zip(pdf_fnames, config_fnames, hs_fnames): with warnings.catch_warnings(record=True): # weight tables raw = read_raw_bti(pdf, config, hs, convert=True, preload=False) with open(pdf, 'rb') as fid: pdf = six.BytesIO(fid.read()) with open(config, 'rb') as fid: config = six.BytesIO(fid.read()) with open(hs, 'rb') as fid: hs = six.BytesIO(fid.read()) with warnings.catch_warnings(record=True): # weight tables raw2 = read_raw_bti(pdf, config, hs, convert=True, preload=False) repr(raw2) assert_array_equal(raw[:][0], raw2[:][0])