def test_symmetric_difference(): """ Test the Region.symmetric_difference() gives expected results" """ a = Region(maxdepth=7) a.add_circles(0, np.radians(-90), np.radians(1)) area = a.get_area() b = Region(maxdepth=7) b.add_circles(0, np.radians(-90), np.radians(0.5)) a.symmetric_difference(b) if not (a.get_area() == area - b.get_area()): raise AssertionError("test_symmetric_difference FAILED")
def test_without(): """ Test the Region.without gives expected results" """ a = Region(maxdepth=7) a.add_circles(0, np.radians(-90), np.radians(1)) area = a.get_area() b = Region(maxdepth=7) b.add_circles(0, np.radians(-90), np.radians(0.5)) a.without(b) if not (a.get_area() <= (area - b.get_area())): raise AssertionError("test_without FAILED")
def test_intersect(): """ Test the Region.intersect gives expected results" """ a = Region(maxdepth=7) a.add_circles(0, np.radians(-90), np.radians(1)) b = Region(maxdepth=7) b.add_circles(0, np.radians(-90), np.radians(0.5)) a.intersect(b) if not (a.get_area() == b.get_area()): raise AssertionError("test_intersect FAILED") a = Region(maxdepth=8) a.add_circles(0, np.radians(75), np.radians(3)) c = Region(maxdepth=8) c.add_circles(0, np.radians(90), np.radians(10)) a.intersect(c) if not (a.get_area() == 0.): raise AssertionError("test_intersect FAILED")