Ejemplo n.º 1
0
 def estimate_daily_route_times(self, day):
     for index, spot in enumerate(self.touristSpots[day]):
         if index + 1 < len(self.touristSpots[day]):
             if spot.address and self.touristSpots[day][index + 1].address:
                 #print ItineraryService.get_travel_duration(spot.address, self.touristSpots[day][index+1].address)
                 time = ItineraryService.get_travel_duration(
                     spot.address,
                     self.touristSpots[day][index + 1].address)
                 if time and 'text' in time:
                     spot.next_dest_time = time['text']
Ejemplo n.º 2
0
 def test_get_travel_duration_valid(self):
     coord1 = (40.80887209540821, -73.96184921264648) # Columbia University Long Lat
     coord2 = (40.73083612189599, -73.99734020233154) # NYU Long Lat
     dur = ItineraryService.get_travel_duration(coord1, coord2)
     self.assertNotEqual(dur, None)