mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Twill-less tool tests - allow tests with GALAXY_TEST_EXTERNAL...
... if GALAXY_TEST_EXTERNAL is ever fixed.
This commit is contained in:
@@ -63,6 +63,7 @@ default_galaxy_test_port_max = 9999
|
||||
default_galaxy_locales = 'en'
|
||||
default_galaxy_test_file_dir = "test-data"
|
||||
default_galaxy_master_key = "TEST123"
|
||||
default_galaxy_user_key = None
|
||||
migrated_tool_panel_config = 'migrated_tools_conf.xml'
|
||||
installed_tool_panel_configs = [ 'shed_tool_conf.xml' ]
|
||||
|
||||
@@ -425,6 +426,7 @@ def main():
|
||||
functional.test_toolbox.build_tests(
|
||||
testing_shed_tools=testing_shed_tools,
|
||||
master_api_key=master_api_key,
|
||||
user_api_key=os.environ.get( "GALAXY_TEST_USER_API_KEY", default_galaxy_user_key ),
|
||||
)
|
||||
test_config = nose.config.Config( env=os.environ, ignoreFiles=ignore_files, plugins=nose.plugins.manager.DefaultPluginManager() )
|
||||
test_config.configure( sys.argv )
|
||||
|
||||
@@ -73,7 +73,7 @@ class GalaxyInteractorApi( object ):
|
||||
def __init__( self, twill_test_case ):
|
||||
self.twill_test_case = twill_test_case
|
||||
self.api_url = "%s/api" % twill_test_case.url.rstrip("/")
|
||||
self.api_key = self.__get_user_key( twill_test_case.master_api_key )
|
||||
self.api_key = self.__get_user_key( twill_test_case.user_api_key, twill_test_case.master_api_key )
|
||||
self.uploads = {}
|
||||
|
||||
def verify_output( self, history_id, output_data, outfile, attributes, shed_tool_id, maxseconds ):
|
||||
@@ -161,7 +161,9 @@ class GalaxyInteractorApi( object ):
|
||||
)
|
||||
return self.__post( "tools", files=files, data=data )
|
||||
|
||||
def __get_user_key( self, admin_key ):
|
||||
def __get_user_key( self, user_key, admin_key ):
|
||||
if user_key:
|
||||
return user_key
|
||||
all_users = self.__get( 'users', key=admin_key ).json()
|
||||
try:
|
||||
test_user = [ user for user in all_users if user["email"] == 'test@bx.psu.edu' ][0]
|
||||
@@ -336,7 +338,7 @@ class GalaxyInteractorTwill( object ):
|
||||
return expanded_inputs
|
||||
|
||||
|
||||
def build_tests( testing_shed_tools=False, master_api_key=None ):
|
||||
def build_tests( testing_shed_tools=False, master_api_key=None, user_api_key=None ):
|
||||
"""
|
||||
If the module level variable `toolbox` is set, generate `ToolTestCase`
|
||||
classes for all of its tests and put them into this modules globals() so
|
||||
@@ -372,6 +374,7 @@ def build_tests( testing_shed_tools=False, master_api_key=None ):
|
||||
namespace[ 'test_tool_%06d' % j ] = test_method
|
||||
namespace[ 'shed_tool_id' ] = shed_tool_id
|
||||
namespace[ 'master_api_key' ] = master_api_key
|
||||
namespace[ 'user_api_key' ] = user_api_key
|
||||
# The new.classobj function returns a new class object, with name name, derived
|
||||
# from baseclasses (which should be a tuple of classes) and with namespace dict.
|
||||
new_class_obj = new.classobj( name, baseclasses, namespace )
|
||||
|
||||
Reference in New Issue
Block a user