コード例 #1
0
ファイル: views.py プロジェクト: hillia/uber_challenge
def predictions(request):
  route_and_stops = request.GET.getlist('stops')
  stops_json = [{'route': route_and_stop.split('|')[0], 'tag': route_and_stop.split('|')[1] } for route_and_stop in route_and_stops]
  return HttpResponse(Predictions.get(agency='sf-muni', stops=stops_json))
コード例 #2
0
ファイル: test_cases.py プロジェクト: hillia/uber_challenge
 def setUp(self):
   self.predictions = Predictions.get(agency='sf-muni', stops=[{'route': 'N', 'tag': 5240}, {'route': 'K', 'tag': 7217}])
   self.predictions._fetch_raw_xml = self.mockPredictionsXml
   self.predictions.fetch()