Nicholas Jones c86c404c31 Move flavor_manager tests to top level folder
Moves all tests under orm/services/flavor_manager to top level tests
folder, and makes changes to get them passing.

Change-Id: I6e1bff032a1a90e60529bd0ed42f1c0b822687df
2017-08-22 13:10:08 -05:00

35 lines
963 B
Python

import os
from orm.common.orm_common.policy import policy
from orm.services.flavor_manager.fms_rest.data import wsme
from orm.services.flavor_manager.fms_rest.logger import get_logger
from orm.services.flavor_manager.fms_rest.utils import authentication
from pecan.commands import CommandRunner
from pecan import make_app
logger = get_logger(__name__)
def setup_app(config):
wsme.init_model()
token_conf = authentication.get_token_conf(config)
policy.init(config.authentication.policy_file, token_conf)
app_conf = dict(config.app)
app = make_app(
app_conf.pop('root'),
logging=getattr(config, 'logging', {}),
**app_conf
)
logger.info('Starting FMS...')
return app
def main():
dir_name = os.path.dirname(__file__)
drive, path_and_file = os.path.splitdrive(dir_name)
path, filename = os.path.split(path_and_file)
runner = CommandRunner()
runner.run(['serve', path + '/config.py'])