def test_add(self): bitmap_set = NdBitmapSet(_shape, elems=[_a, _b, _c]) # new element added set bitmap_set.add(_d) # was already in set bitmap_set.add(_b) self.assertListEqual(list(bitmap_set), [_a, _b, _c, _d])
def test_copy(self): bitmap_set = NdBitmapSet(_shape, elems=[_a, _b, _c]) other = bitmap_set.copy() self.assertTrue(bitmap_set == other) # copy is a distinct object self.assertTrue(id(bitmap_set) != id(other)) bitmap_set.add(_d) other.remove(_c) self.assertTrue(bitmap_set != other)