def test_initrange(self): # creates a positive, dense, and inverted block, respectively for n in [400, 6000, 61241]: ref = set(range(23, n)) rb = ImmutableRoaringBitmap(range(23, n)) rb._checkconsistency() assert ref == rb, n
def test_inittrivial(self): data = list(range(5)) ref = set(data) rb = ImmutableRoaringBitmap(data) rb._checkconsistency() assert ref == rb assert type(rb) == ImmutableRoaringBitmap
def test_inittrivial(self): data = list(range(5)) ref = set(data) rb = ImmutableRoaringBitmap(data) rb._checkconsistency() assert ref == rb assert type(rb) == ImmutableRoaringBitmap
def test_pickle(self, single): for name, data in single: rb = ImmutableRoaringBitmap(data) rb_pickled = pickle.dumps(rb, protocol=-1) rb_unpickled = pickle.loads(rb_pickled) rb._checkconsistency() assert rb_unpickled == rb, name assert type(rb) == ImmutableRoaringBitmap, name
def test_pickle(self, single): for name, data in single: rb = ImmutableRoaringBitmap(data) rb_pickled = pickle.dumps(rb, protocol=-1) rb_unpickled = pickle.loads(rb_pickled) rb._checkconsistency() assert rb_unpickled == rb, name assert type(rb) == ImmutableRoaringBitmap, name
def test_inititerator(self, single): for name, data in single: ref = set(a for a in data) rb = ImmutableRoaringBitmap(a for a in data) rb._checkconsistency() assert ref == rb, name
def test_initunsorted(self, single): for name, data in single: ref = set(data) rb = ImmutableRoaringBitmap(data) rb._checkconsistency() assert ref == rb, name