コード例 #1
0
    def setUp(self):
        super(FunctionalTest, self).setUp()
        zun.conf.CONF.set_override("auth_version",
                                   "v2.0",
                                   group='keystone_authtoken')
        zun.conf.CONF.set_override("admin_user",
                                   "admin",
                                   group='keystone_authtoken')

        # Determine where we are so we can set up paths in the config
        root_dir = self.get_path()
        self.config = {
            'app': {
                'root':
                'zun.api.controllers.root.RootController',
                'modules': ['zun.api'],
                'static_root':
                '%s/public' % root_dir,
                'template_path':
                '%s/api/templates' % root_dir,
                'hooks': [
                    hooks.ContextHook(),
                    hooks.RPCHook(),
                    hooks.NoExceptionTracebackHook(),
                ],
            },
        }

        self.app = self._make_app()

        def reset_pecan():
            pecan.set_config({}, overwrite=True)

        self.addCleanup(reset_pecan)
コード例 #2
0
    def setUp(self):
        super(FunctionalTest, self).setUp()
        # NOTE(yuywz): In API test cases, we use sqllite as the DB
        # backend, so we should set 'db_type' to 'sql' to access
        # sqllite DB with sqlalchemy api.
        cfg.CONF.set_override('db_type', 'sql')
        zun.conf.CONF.set_override("auth_version",
                                   "v2.0",
                                   group='keystone_authtoken',
                                   enforce_type=True)
        zun.conf.CONF.set_override("admin_user",
                                   "admin",
                                   group='keystone_authtoken',
                                   enforce_type=True)

        # Determine where we are so we can set up paths in the config
        root_dir = self.get_path()
        self.config = {
            'app': {
                'root':
                'zun.api.controllers.root.RootController',
                'modules': ['zun.api'],
                'static_root':
                '%s/public' % root_dir,
                'template_path':
                '%s/api/templates' % root_dir,
                'hooks': [
                    hooks.ContextHook(),
                    hooks.RPCHook(),
                    hooks.NoExceptionTracebackHook(),
                ],
            },
        }

        self.app = self._make_app()

        def reset_pecan():
            pecan.set_config({}, overwrite=True)

        self.addCleanup(reset_pecan)
コード例 #3
0
ファイル: config.py プロジェクト: zwphit/zun
# Copyright 2013 - Noorul Islam K M
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from zun.api import hooks

# Pecan Application Configurations
app = {
    'root':
    'zun.api.controllers.root.RootController',
    'modules': ['zun'],
    'hooks': [
        hooks.ContextHook(),
        hooks.NoExceptionTracebackHook(),
        hooks.RPCHook(),
    ],
    'debug':
    False,
}