def route(self, onestop_id):
   """Return a single route by Onestop ID."""
   return util.filtfirst(self.routes(), onestop=onestop_id)
Beispiel #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)
Beispiel #4
0
 def test_filtfirst_name(self):
   data = util.filtfirst(self.testdata, name='Foo')
   assert data.name() == 'Foo'
Beispiel #5
0
 def test_filtfirst_id(self):
   data = util.filtfirst(self.testdata, id='1')
   assert data.id() == '1'
Beispiel #6
0
 def test_filtfirst_id(self):
     data = util.filtfirst(self.testdata, id='1')
     assert data.id() == '1'
Beispiel #7
0
 def stop(self, key):
     """Return a single stop by ID."""
     return util.filtfirst(self.stops(), id=key)
Beispiel #8
0
 def route(self, onestop_id):
     """Return a single route by Onestop ID."""
     return util.filtfirst(self.routes(), onestop=onestop_id)
Beispiel #9
0
 def route(self, key):
     """Return a single route by ID."""
     return util.filtfirst(self.routes(), id=key)
Beispiel #10
0
 def stop(self, key):
   """Return a single stop by ID."""
   return util.filtfirst(self.stops(), id=key)
Beispiel #11
0
 def stop(self, onestop_id):
     """Return a single stop by Onestop ID."""
     return util.filtfirst(self.stops(), onestop=onestop_id)
Beispiel #12
0
 def trip(self, key):
   """Return a single trip by ID."""
   return util.filtfirst(self.trips(), id=key)
Beispiel #13
0
 def route(self, key):
   """Return a single route by ID."""
   return util.filtfirst(self.routes(), id=key)
Beispiel #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')
 def stop(self, onestop_id):
   """Return a single stop by Onestop ID."""
   return util.filtfirst(self.stops(), onestop=onestop_id)
Beispiel #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)
Beispiel #18
0
 def test_filtfirst_name(self):
     data = util.filtfirst(self.testdata, name='Foo')
     assert data.name() == 'Foo'