Exemple #1
0
    def setUpClass(cls):
        super(TestBase, cls).setUpClass()
        TestBase._proxy = admin.Bootstrap()

        TestBase._app = TestBase._proxy.transport.app
        partitions_controller = TestBase._proxy.storage.partitions_controller
        catalogue_controller = TestBase._proxy.storage.catalogue_controller
        cache = TestBase._proxy.cache
        selector = round_robin.Selector()

        # NOTE(cpp-cabrera): allow for queue creation: needed for
        # catalogue tests
        TestBase._app.add_route(version.path() + '/queues/{queue}',
                                queues.Resource(partitions_controller,
                                                catalogue_controller,
                                                cache, selector))

        # NOTE(cpp-cabrera): allow for queue listing
        # TODO(cpp-cabrera): move this out into proxy:public test base
        TestBase._app.add_route(version.path() + '/queues',
                                queues.Listing(catalogue_controller))
Exemple #2
0
 def _init_routes(self):
     version_path = version.path()
     self.app = falcon.API(before=[helpers.require_accepts_json])
     for route, resource in self.bridge:
         self.app.add_route(version_path + route, resource)