def setUpClass(cls): global src, fd, size, doffset, dlength, nrows, ncols, index inputfile = os.path.realpath( os.path.dirname(os.path.realpath(__file__)) + "/../../c/test/data/test_data_col.bin") src, fd, size, doffset, dlength, nrows, ncols, index, idx = bs.mmap_binfile( inputfile, [1, 2, 4, 8]) if fd < 0 or size != 3776: assert False, "Unable to open the file"
def test_load_arrow(self): inputfile = os.path.realpath( os.path.dirname(os.path.realpath(__file__)) + "/../../c/test/data/test_data_arrow.bin") src, fd, size, doffset, dlength, nrows, ncols, index, idx = bs.mmap_binfile( inputfile, [4, 8]) if fd < 0 or size != 730: assert False, "Unable to open the file" self.assertEqual(doffset, 376) self.assertEqual(dlength, 136) self.assertEqual(nrows, 11) self.assertEqual(ncols, 2) self.assertEqual(index[0], 376) self.assertEqual(index[1], 424) h = bs.munmap_binfile(src, fd, size) if h != 0: assert False, "Error while closing the memory-mapped file"