def route(self, onestop_id):
   """Return a single route by Onestop ID."""
   return util.filtfirst(self.routes(), onestop=onestop_id)
Esempio n. 2
0
 def test_filtfirst_empty(self):
   with self.assertRaises(ValueError):
     util.filtfirst(self.testdata, name='Asdf')
   with self.assertRaises(ValueError):
     util.filtfirst(self.testdata, id='0')
 def operator(self, onestop_id):
   """Return a single operator by Onestop ID."""
   return util.filtfirst(self.operators(), onestop=onestop_id)
Esempio n. 4
0
 def test_filtfirst_name(self):
   data = util.filtfirst(self.testdata, name='Foo')
   assert data.name() == 'Foo'
Esempio n. 5
0
 def test_filtfirst_id(self):
   data = util.filtfirst(self.testdata, id='1')
   assert data.id() == '1'
Esempio n. 6
0
 def test_filtfirst_id(self):
     data = util.filtfirst(self.testdata, id='1')
     assert data.id() == '1'
Esempio n. 7
0
 def stop(self, key):
     """Return a single stop by ID."""
     return util.filtfirst(self.stops(), id=key)
Esempio n. 8
0
 def route(self, onestop_id):
     """Return a single route by Onestop ID."""
     return util.filtfirst(self.routes(), onestop=onestop_id)
Esempio n. 9
0
 def route(self, key):
     """Return a single route by ID."""
     return util.filtfirst(self.routes(), id=key)
Esempio n. 10
0
 def stop(self, key):
   """Return a single stop by ID."""
   return util.filtfirst(self.stops(), id=key)
Esempio n. 11
0
 def stop(self, onestop_id):
     """Return a single stop by Onestop ID."""
     return util.filtfirst(self.stops(), onestop=onestop_id)
Esempio n. 12
0
 def trip(self, key):
   """Return a single trip by ID."""
   return util.filtfirst(self.trips(), id=key)
Esempio n. 13
0
 def route(self, key):
   """Return a single route by ID."""
   return util.filtfirst(self.routes(), id=key)
Esempio n. 14
0
 def test_filtfirst_empty(self):
     with self.assertRaises(ValueError):
         util.filtfirst(self.testdata, name='Asdf')
     with self.assertRaises(ValueError):
         util.filtfirst(self.testdata, id='0')
Esempio n. 15
0
 def stop(self, onestop_id):
   """Return a single stop by Onestop ID."""
   return util.filtfirst(self.stops(), onestop=onestop_id)
Esempio n. 16
0
 def trip(self, key):
     """Return a single trip by ID."""
     return util.filtfirst(self.trips(), id=key)
 def operator(self, onestop_id):
     """Return a single operator by Onestop ID."""
     return util.filtfirst(self.operators(), onestop=onestop_id)
Esempio n. 18
0
 def test_filtfirst_name(self):
     data = util.filtfirst(self.testdata, name='Foo')
     assert data.name() == 'Foo'