Ejemplo n.º 1
0
 def __init__(self):
     Uri.__init__(self,
                  is_collection,
                  "physical_modes",
                  output_type_serializer=api.PhysicalModesSerializer)
     self.collections = get_collections(self.collection)
     self.get_decorators.insert(1, get_obj_serializer(self))
Ejemplo n.º 2
0
 def __init__(self):
     Uri.__init__(self,
                  is_collection,
                  "datasets",
                  output_type_serializer=api.DatasetsSerializer)
     self.collections = get_collections(self.collection)
     self.get_decorators.insert(1, get_obj_serializer(self))
Ejemplo n.º 3
0
        def __init__(self):
            Uri.__init__(self,
                         is_collection,
                         "pois",
                         output_type_serializer=api.PoisSerializer)
            self.collections = get_collections(self.collection)
            self.get_decorators.insert(1, get_obj_serializer(self))
            self.parsers["get"].add_argument(
                "original_id",
                type=six.text_type,
                help="original uri of the object you want to query")
            self.parsers["get"].add_argument(
                "bss_stands",
                type=BooleanType(),
                default=True,
                help="Show bss stands availability")
            self.parsers["get"].add_argument(
                "add_poi_infos[]",
                type=OptionValue(add_poi_infos_types),
                default=['bss_stands', 'car_park'],
                dest="add_poi_infos",
                action="append",
                help=
                "Show more information about the poi if it's available, for instance,"
                " show BSS/car park availability in the pois(BSS/car park) of "
                "response")

            args = self.parsers["get"].parse_args()
            if args["add_poi_infos"] or args["bss_stands"]:
                self.get_decorators.insert(2,
                                           ManageParkingPlaces(self, 'pois'))
Ejemplo n.º 4
0
 def __init__(self):
     Uri.__init__(self,
                  is_collection,
                  "vehicle_journeys",
                  output_type_serializer=api.VehicleJourneysSerializer)
     self.collections = get_collections(self.collection)
     self.get_decorators.insert(1, get_obj_serializer(self))
Ejemplo n.º 5
0
 def __init__(self):
     Uri.__init__(self,
                  is_collection,
                  "journey_patterns",
                  output_type_serializer=api.JourneyPatternsSerializer)
     self.collections = get_collections(self.collection)
     self.get_decorators.insert(1, get_obj_serializer(self))
Ejemplo n.º 6
0
 def __init__(self):
     Uri.__init__(self,
                  is_collection,
                  "disruptions",
                  output_type_serializer=api.DisruptionsSerializer)
     self.collections = get_collections(self.collection)
     self.get_decorators.insert(1, get_obj_serializer(self))
     self.parsers["get"].add_argument(
         "original_id",
         type=six.text_type,
         help="original uri of the object you want to query")
Ejemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     Uri.__init__(self,
                  is_collection,
                  "stop_points",
                  output_type_serializer=api.StopPointsSerializer,
                  *args,
                  **kwargs)
     self.collections = get_collections(self.collection)
     self.get_decorators.insert(1, get_obj_serializer(self))
     self.parsers["get"].add_argument(
         "original_id",
         type=six.text_type,
         help="original uri of the object you want to query")
Ejemplo n.º 8
0
def test_disruption_collection_name():
    disruptions = get_collections('disruptions')
    assert len(disruptions) == 5
Ejemplo n.º 9
0
def test_invalid_collection_name():
    with pytest.raises(CollectionException):
        get_collections('toto')