Ejemplo n.º 1
0
def setup_app(config=None):
    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    app = pecan.make_app(app_conf.pop('root'),
                         logging=getattr(config, 'logging', {}),
                         wrap_app=middleware.ParsableErrorMiddleware,
                         **app_conf)

    #    TBD Add test hook later
    #    cpulseTimer(10, timerfunc, "Cpulse")
    cpulseTimer(30, timerfunc, "Cpulse")
    tm = Periodic_TestManager()
    tm.start()
    return auth.install(app, CONF, config.app.acl_public_routes)
Ejemplo n.º 2
0
def setup_app(config=None):
    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    app = pecan.make_app(
        app_conf.pop('root'),
        logging=getattr(config, 'logging', {}),
        wrap_app=middleware.ParsableErrorMiddleware,
        **app_conf
    )

#    TBD Add test hook later
#    cpulseTimer(10, timerfunc, "Cpulse")
    cpulseTimer(30, timerfunc, "Cpulse")
    tm = Periodic_TestManager()
    tm.start()
    return auth.install(app, CONF, config.app.acl_public_routes)
Ejemplo n.º 3
0
 def test_check_auth_option_disabled(self, mock_auth):
     self.CONF.config(enable_authentication=False)
     result = auth.install(self.app, self.CONF.conf, ['/'])
     self.assertIsInstance(result, fakes.FakeApp)
Ejemplo n.º 4
0
 def test_check_auth_option_disabled(self, mock_auth):
     self.CONF.config(enable_authentication=False)
     result = auth.install(self.app, self.CONF.conf, ["/"])
     self.assertIsInstance(result, fakes.FakeApp)