def test_mapbox(self):
     # Mapbox returns a valid result
     d = DirectionsHelper()
     result = d.get_directions(start_location=self.a, end_location=self.b)
     self.assertEqual("Mapbox", result.source)
 def test_all_bad(self):
     # all directions providers throw a DirectionsException
     # get_directions() should return None
     d = DirectionsHelper()
     result = d.get_directions(start_location=self.a, end_location=self.b)
     self.assertIsNone(result)
 def test_google(self):
     # Mapbox throws an exception
     # Fall back to google
     d = DirectionsHelper()
     result = d.get_directions(start_location=self.a, end_location=self.b)
     self.assertEqual("Google", result.source)
 def test_bad_params(self):
     # params passed are invalid
     d = DirectionsHelper()
     result = d.get_directions(start_location=False, end_location=False)
     self.assertIsNone(result)