def test_boxlist_inside(): b = BoxList() b.append(Box(Rectangle(0, 0, 10, 10))) infrect = Box(Rectangle(-inf, -inf, inf, inf)) assert_equals(1, len(b.inside(infrect))) assert_equals(0, len(b.inside(Box.empty_box)))
def test_boxlist_inside_not_inside(): b = BoxList() b.append(Box(Rectangle(0, 0, 10, 10))) otherbox = Box(Rectangle(-100, -100, -90, -90)) assert_equals(0, len(b.inside(otherbox)))