def _get_initialized_app_context(parsed_args):
"""
:param parsed_args: parsed args (eg. from take_action)
:return: (wsgi_app, test_app)
"""
config_file = parsed_args.config_file
config_name = 'config:%s' % config_file
here_dir = os.getcwd()
# Load locals and populate with objects for use in shell
sys.path.insert(0, here_dir)
# Load the wsgi app first so that everything is initialized right
wsgi_app = loadapp(config_name, relative_to=here_dir)
test_app = TestApp(wsgi_app)
# Make available the tg.request and other global variables
tresponse = test_app.get('/_test_vars')
return wsgi_app, test_app
评论列表
文章目录