def test_difference(self): bitmap_set = NdBitmapSet(_shape, elems=[_a, _b, _c]) other = NdBitmapSet(_shape, elems=[_b, _c, _d]) expected = NdBitmapSet(_shape, elems=[_a]) self.assertNdBitmapSetEqual(bitmap_set.difference(other), expected) self.assertNdBitmapSetEqual(bitmap_set - other, expected) expected = NdBitmapSet(_shape, elems=[_d]) self.assertNdBitmapSetEqual(other - bitmap_set, expected)
def test_difference_multiple_others(self): bitmap_set = NdBitmapSet(_shape, elems=[_a, _b, _c, _d]) others = [ NdBitmapSet(_shape, elems=[_a]), NdBitmapSet(_shape, elems=[_c]), NdBitmapSet(_shape, elems=[_d]), ] expected = NdBitmapSet(_shape, elems=[_b]) self.assertNdBitmapSetEqual(bitmap_set.difference(*others), expected)