Beispiel #1
0
 def test_distance_function_properly_computes_distance_in_miles_for_long_distances(self):
     # creating the test-points
     lat1, lon1 = (35.5800, -82.5558)
     lat2, lon2 = (35.0117, 135.7683)
     # externally calculated approx distance in miles
     approx_dist = 6984
     self.assertAlmostEqual(distance.distance_test(lat1, lon1, lat2, lon2),
         approx_dist, delta=15)
Beispiel #2
0
 def test_distance_function_properly_computes_distance_in_miles(self):
     # creating the test-points
     lat1, lon1 = 0, 0
     lat2, lon2 = 1, 1
     # externally calculated approx distance in miles
     approx_dist = 97.68
     # assert almost equal, inherent uncertainty in approximate
     # methods, this implementation is "good enough," due to speed concerns
     self.assertAlmostEqual(distance.distance_test(lat1, lon1, lat2, lon2),
         approx_dist, delta=.1)