summaryrefslogtreecommitdiff
path: root/stsci/sphere/test
diff options
context:
space:
mode:
Diffstat (limited to 'stsci/sphere/test')
-rw-r--r--stsci/sphere/test/test_intersection.py12
-rw-r--r--stsci/sphere/test/test_union.py12
2 files changed, 24 insertions, 0 deletions
diff --git a/stsci/sphere/test/test_intersection.py b/stsci/sphere/test/test_intersection.py
index 3576cc1..08ed258 100644
--- a/stsci/sphere/test/test_intersection.py
+++ b/stsci/sphere/test/test_intersection.py
@@ -176,6 +176,18 @@ def test6():
return [poly1, poly2]
+def test_union_empty():
+ p = polygon.SphericalPolygon.from_cone(
+ random.randrange(-180, 180),
+ random.randrange(20, 90),
+ random.randrange(5, 16),
+ steps=16)
+
+ p2 = p.intersection(polygon.SphericalPolygon([]))
+
+ assert_array_almost_equal(p2._points, p._points)
+
+
if __name__ == '__main__':
if '--profile' not in sys.argv:
GRAPH_MODE = True
diff --git a/stsci/sphere/test/test_union.py b/stsci/sphere/test/test_union.py
index b106907..24de9e6 100644
--- a/stsci/sphere/test/test_union.py
+++ b/stsci/sphere/test/test_union.py
@@ -214,3 +214,15 @@ if __name__ == '__main__':
functions.sort()
for k, v in functions:
v()
+
+
+def test_union_empty():
+ p = polygon.SphericalPolygon.from_cone(
+ random.randrange(-180, 180),
+ random.randrange(20, 90),
+ random.randrange(5, 16),
+ steps=16)
+
+ p2 = p.union(polygon.SphericalPolygon([]))
+
+ assert_array_almost_equal(p2._points, p._points)