From 6ae25bb6cfc14a9b4f71db4c4ea7552194c2528e Mon Sep 17 00:00:00 2001 From: mdroe Date: Fri, 6 Jun 2014 01:23:22 +0000 Subject: Fix union with empty polygon. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci.sphere/trunk@32433 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: ad718756b906e7254f8a899a8683e641e8396c17 --- stsci/sphere/test/test_union.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'stsci/sphere/test/test_union.py') 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) -- cgit