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_overlapped(cel): # TODO: switch to quadtree return overlaps(cel.bounds, (x1, y1, x2, y2))