1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/da89c3556c27/ changeset: da89c3556c27 user: carlfeberhard date: 2013-01-17 20:58:43 summary: Enable serving static files when running functional tests affected #: 1 file diff -r 7848d6fd1b7a3ef8330ad1b31f5a3521094ad706 -r da89c3556c27c8f1e5acf943c6983be5437efac6 scripts/functional_tests.py --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -50,6 +50,41 @@ migrated_tool_panel_config = 'migrated_tools_conf.xml' installed_tool_panel_configs = [ 'shed_tool_conf.xml' ] +# should this serve static resources (scripts, images, styles, etc.) +STATIC_ENABLED = True + +def get_static_settings(): + """Returns dictionary of the settings necessary for a galaxy App + to be wrapped in the static middleware. + + This mainly consists of the filesystem locations of url-mapped + static resources. + """ + cwd = os.getcwd() + static_dir = os.path.join( cwd, 'static' ) + #TODO: these should be copied from universe_wsgi.ini + return dict( + #TODO: static_enabled needed here? + static_enabled = True, + static_cache_time = 360, + static_dir = static_dir, + static_images_dir = os.path.join( static_dir, 'images', '' ), + static_favicon_dir = os.path.join( static_dir, 'favicon.ico' ), + static_scripts_dir = os.path.join( static_dir, 'scripts', '' ), + static_style_dir = os.path.join( static_dir, 'june_2007_style', 'blue' ), + static_robots_txt = os.path.join( static_dir, 'robots.txt' ), + ) + +def get_webapp_global_conf(): + """Get the global_conf dictionary sent as the first argument to app_factory. + """ + # (was originally sent 'dict()') - nothing here for now except static settings + global_conf = dict() + if STATIC_ENABLED: + global_conf.update( get_static_settings() ) + return global_conf + + def parse_tool_panel_config( config, shed_tools_dict ): """ Parse a shed-related tool panel config to generate the shed_tools_dict. This only happens when testing tools installed from the tool shed. @@ -289,7 +324,8 @@ server = None if start_server: - webapp = buildapp.app_factory( dict(), use_translogger=False, static_enabled=False, app=app ) + webapp = buildapp.app_factory( get_webapp_global_conf(), app=app, + use_translogger=False, static_enabled=STATIC_ENABLED ) if galaxy_test_port is not None: server = httpserver.serve( webapp, host=galaxy_test_host, port=galaxy_test_port, start_loop=False ) else: Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.