def test_get_closest_distance_inside_region(self):
     # Inside reference region
     reference = 1240000
     position1 = 1200000
     position2 = 1255000
     self.assertEqual(closestDistanceToRegion(reference,position1,position2),
                      abs(reference-position2),
                      "Incorrect closest distance (inside region #1)")
     self.assertEqual(closestDistanceToRegion(reference,position1,position2,
                                              zero_inside_region=True),
                      0,
                      "Incorrect closest distance (inside region #2)")
 def test_get_distance_to_point(self):
     # Single position
     reference = 1240000
     position = 1200000
     # Single reference position
     self.assertEqual(closestDistanceToRegion(reference,position),
                      abs(reference-position),
                      "Incorrect distance #1")
     position = 1300000
     self.assertEqual(closestDistanceToRegion(reference,position),
                      abs(reference-position),
                      "Incorrect distance #2")
 def test_get_closest_distance_outside_region(self):
     # Outside reference region (2 positions)
     reference = 1240000
     position1 = 1100000
     position2 = 1200000
     self.assertEqual(closestDistanceToRegion(reference,position1,position2),
                      abs(reference-position2),
                      "Incorrect closest distance (outside region #1)")
     position1 = 1300000
     position2 = 1400000
     self.assertEqual(closestDistanceToRegion(reference,position1,position2),
                      abs(reference-position1),
                      "Incorrect closest distance (outside region #2)")