Skip to content

Commit

Permalink
add further tests for intersect method
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHancock committed Aug 9, 2018
1 parent 2022385 commit ed11261
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/test_regions.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
"""

from __future__ import print_function

__author__ = 'Paul Hancock'

from AegeanTools.regions import Region
import numpy as np
import os

__author__ = 'Paul Hancock'


def test_radec2sky():
"""Test function: Region.radec2sky"""
Expand Down Expand Up @@ -202,7 +201,16 @@ def test_intersect():
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")
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")


def test_demote():
Expand Down

0 comments on commit ed11261

Please sign in to comment.