def test_fits(self, bounds_A, bounds_B, should_fit, should_overlap): assert fits(bounds_A, bounds_B) == should_fit assert overlaps(bounds_A, bounds_B) == should_overlap
def is_enclosed(cel): # TODO: switch to quadtree return fits(cel.bounds, (x1, y1, x2, y2))