Ejemplo n.º 1
0
 def test_valid_service_names(self):
     """Valid service names don't throw exceptions
     """
     try:
         for service_name in ['metro', 'ulsterbus', 'goldline', 'nir', 'enterprise']:
             Service(service_name)
     except InvalidServiceError:
         self.fail('InvalidServiceError raised unexpectedly')
Ejemplo n.º 2
0
 def test_enterprise_route_count(self):
     """Test that the enterprise service returns the correct number of routes
     """
     service = Service('enterprise')
     with self.assertRaises(NotImplementedError):
         service.routes()
Ejemplo n.º 3
0
 def test_ulsterbus_route_count(self):
     """Test that the ulsterbus service returns the correct number of routes
     """
     service = Service('ulsterbus')
     self.assertEqual(454, len(service.routes()))
Ejemplo n.º 4
0
 def test_metro_route_count(self):
     """Test that the metro service returns the correct number of routes
     """
     service = Service('metro')
     self.assertEqual(102, len(service.routes()))
Ejemplo n.º 5
0
 def test_goldline_route_count(self):
     """Test that the goldline service returns the correct number of routes
     """
     service = Service('goldline')
     self.assertEqual(34, len(service.routes()))
Ejemplo n.º 6
0
 def test_invalid_service_names(self):
     """Invalid service name throws exceptions
     """
     with self.assertRaises(InvalidServiceError):
         Service('metrov')