예제 #1
0
 def testWhati(self):
     stop1 = stop.Stop(lat=63.1, lng=-117.2, name='whati one', stop_id='1')
     stop2 = stop.Stop(lat=63.102,
                       lng=-117.201,
                       name='whati two',
                       stop_id='2')
     self.assertAlmostEqual(
         util.approximate_distance_between_stops(stop1, stop2), 228, 0)
예제 #2
0
 def testWhati(self):
     stop1 = stop.Stop(lat=63.1, lng=-117.2, name="whati one", stop_id="1")
     stop2 = stop.Stop(lat=63.102, lng=-117.201, name="whati two", stop_id="2")
     self.assertAlmostEqual(
         util.ApproximateDistanceBetweenStops(stop1, stop2), 228, 0
     )
예제 #3
0
 def testEquator(self):
     stop1 = stop.Stop(lat=0, lng=100, name='Stop one', stop_id='1')
     stop2 = stop.Stop(lat=0.01, lng=100.01, name='Stop two', stop_id='2')
     self.assertAlmostEqual(
         util.approximate_distance_between_stops(stop1, stop2), 1570,
         -1)  # Compare first 3 digits
예제 #4
0
 def testEquator(self):
     stop1 = stop.Stop(lat=0, lng=100, name="Stop one", stop_id="1")
     stop2 = stop.Stop(lat=0.01, lng=100.01, name="Stop two", stop_id="2")
     self.assertAlmostEqual(
         util.ApproximateDistanceBetweenStops(stop1, stop2), 1570, -1
     )  # Compare first 3 digits