commit/galaxy-central: davebgx: Update tool shed twilltestcase methods to reflect changes in the base twilltestcase's visit_url method. Fix functional tests for the tool shed. Update test tool dependencies to not actually compile EMBOSS and freebayes.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/cf9cd1027e2a/ Changeset: cf9cd1027e2a User: davebgx Date: 2014-04-24 17:23:03 Summary: Update tool shed twilltestcase methods to reflect changes in the base twilltestcase's visit_url method. Fix functional tests for the tool shed. Update test tool dependencies to not actually compile EMBOSS and freebayes. Affected #: 4 files diff -r f1cb12e876c659c456c0b10f577494f79211b7f4 -r cf9cd1027e2a7e3f29201125fbbacf929ef55d0b test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -284,30 +284,6 @@ category = test_db_util.get_category_by_name( kwd[ 'name' ] ) return category - def create_checkbox_query_string( self, field_name, value ): - ''' - From galaxy.web.form_builder.CheckboxField: - The hidden field is necessary because if the check box is not checked on the form, it will - not be included in the request params. The hidden field ensure that this will happen. When - parsing the request, the value 'true' in the hidden field actually means it is NOT checked. - See the is_checked() method below. The prefix is necessary in each case to ensure functional - correctness when the param is inside a conditional. - - This may look strange upon initial inspection, but see the comments in the get_html() method - above for clarification. Basically, if value is not True, then it will always be a list with - 2 input fields ( a checkbox and a hidden field ) if the checkbox is checked. If it is not - checked, then value will be only the hidden field. - - The create_checkbox_query_string method emulates the described behavior with URL query parameters. - This is currently necessary because twill does not correctly parse certain forms, so the test - method has to visit the intended form target "manually". - ''' - field_value = str( value ).lower() - if value: - return '%s=%s&%s=%s' % ( field_name, field_value, field_name, field_value ) - else: - return '%s=%s' % ( field_name, field_value ) - def create_repository_dependency( self, repository=None, repository_tuples=[], @@ -547,7 +523,8 @@ def enable_email_alerts( self, repository, strings_displayed=[], strings_not_displayed=[] ): repository_id = self.security.encode_id( repository.id ) - self.visit_url( '/repository/browse_repositories?operation=Receive+email+alerts&id=%s' % repository_id ) + params = dict( operation='Receive email alerts', id=repository_id ) + self.visit_url( '/repository/browse_repositories' ) self.check_for_strings( strings_displayed ) def escape_html( self, string, unescape=False ): @@ -816,15 +793,19 @@ strings_not_displayed = [] self.visit_url( '/admin/roles' ) self.check_for_strings( strings_displayed, strings_not_displayed ) - url = '/admin/roles?operation=manage+users+and+groups&id=%s' % self.security.encode_id( role.id ) + params = dict( operation='manage users and groups', id=self.security.encode_id( role.id ) ) + url = '/admin/roles' self.visit_url( url ) strings_displayed = [ common.test_user_1_email, common.test_user_2_email ] self.check_for_strings( strings_displayed, strings_not_displayed ) # As elsewhere, twill limits the possibility of submitting the form, this time due to not executing the javascript # attached to the role selection form. Visit the action url directly with the necessary parameters. - url = '/admin/manage_users_and_groups_for_role?id=%s&in_users=%d&operation=manage+users+and+groups&role_members_edit_button=Save' % \ - ( self.security.encode_id( role.id ), user.id ) - self.visit_url( url ) + params = dict( id=self.security.encode_id( role.id ), + in_users=user.id, + operation='manage users and groups', + role_members_edit_button='Save' ) + url = '/admin/manage_users_and_groups_for_role' + self.visit_url( url, params ) strings_displayed = [ "Role '%s' has been updated" % role.name ] self.check_for_strings( strings_displayed, strings_not_displayed ) @@ -1050,8 +1031,9 @@ self.check_for_strings( strings_displayed, strings_not_displayed ) def reactivate_repository( self, installed_repository ): - url = '/admin_toolshed/browse_repositories?operation=activate+or+reinstall&id=%s' % self.security.encode_id( installed_repository.id ) - self.visit_galaxy_url( url ) + params = dict( operation='activate or reinstall', id=self.security.encode_id( installed_repository.id ) ) + url = '/admin_toolshed/browse_repositories' + self.visit_galaxy_url( url, params ) strings_displayed = [ installed_repository.name, 'repository has been activated' ] self.check_for_strings( strings_displayed, [] ) @@ -1068,12 +1050,12 @@ self.check_for_strings( strings_displayed, strings_not_displayed=[] ) # Build the url that will simulate a filled-out form being submitted. Due to a limitation in twill, the reselect_tool_panel_section # form doesn't get parsed correctly. - repo_dependencies = self.create_checkbox_query_string( field_name='install_repository_dependencies', value=install_repository_dependencies ) - tool_dependencies = self.create_checkbox_query_string( field_name='install_tool_dependencies', value=install_tool_dependencies ) encoded_repository_id = self.security.encode_id( installed_repository.id ) - url = '/admin_toolshed/reinstall_repository?id=%s&%s&%s&no_changes=%s&new_tool_panel_section_label=%s' % \ - ( encoded_repository_id, repo_dependencies, tool_dependencies, str( no_changes ), new_tool_panel_section_label ) - self.visit_galaxy_url( url ) + params = dict( id=encoded_repository_id, no_changes=no_changes, new_tool_panel_section_label=new_tool_panel_section_label ) + checkbox_params = dict( install_repository_dependencies=install_repository_dependencies, + install_tool_dependencies=install_tool_dependencies ) + url = '/admin_toolshed/reinstall_repository' + self.visit_galaxy_url( url, params=params, checkbox_params=checkbox_params ) # Manually initiate the install process, as with installing a repository. See comments in the # initiate_installation_process method for details. repository_ids = self.initiate_installation_process( install_tool_dependencies, @@ -1429,8 +1411,9 @@ for tool in installed_repository.metadata[ 'tools' ]: strings = list( strings_displayed ) strings.extend( [ tool[ 'id' ], tool[ 'description' ], tool[ 'version' ], tool[ 'guid' ], tool[ 'name' ] ] ) - url = '/admin_toolshed/view_tool_metadata?repository_id=%s&tool_id=%s' % ( repository_id, urllib.quote_plus( tool[ 'id' ] ) ) - self.visit_galaxy_url( url ) + params = dict( repository_id=repository_id, tool_id=tool[ 'id' ] ) + url = '/admin_toolshed/view_tool_metadata' + self.visit_galaxy_url( url, params ) self.check_for_strings( strings, strings_not_displayed ) def verify_unchanged_repository_metadata( self, repository ): @@ -1451,9 +1434,9 @@ self.visit_galaxy_url( url ) self.check_for_strings( strings, strings_not_displayed ) - def visit_galaxy_url( self, url ): + def visit_galaxy_url( self, url, params=None, checkbox_params=None ): url = '%s%s' % ( self.galaxy_url, url ) - self.visit_url( url ) + self.visit_url( url, params=params, checkbox_params=checkbox_params ) def wait_for_repository_installation( self, repository_ids ): final_states = [ galaxy_model.ToolShedRepository.installation_status.ERROR, diff -r f1cb12e876c659c456c0b10f577494f79211b7f4 -r cf9cd1027e2a7e3f29201125fbbacf929ef55d0b test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py --- a/test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py +++ b/test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py @@ -111,8 +111,9 @@ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) strings_displayed=[ 'Handle repository dependencies', 'convert_chars_1087', self.get_repository_tip( convert_repository ) ] # Due to twill's limitations, only check for strings on the (redirected) reselect tool panel section page, don't actually reinstall. - url = '/admin_toolshed/browse_repositories?operation=activate+or+reinstall&id=%s' % self.security.encode_id( installed_column_repository.id ) - self.visit_galaxy_url( url ) + params = dict( operation='activate or reinstall', id=self.security.encode_id( installed_column_repository.id ) ) + url = '/admin_toolshed/browse_repositories' + self.visit_galaxy_url( url, params ) self.check_for_strings( strings_displayed ) strings_not_displayed = [ 'column_maker_1087' ] - self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) \ No newline at end of file diff -r f1cb12e876c659c456c0b10f577494f79211b7f4 -r cf9cd1027e2a7e3f29201125fbbacf929ef55d0b test/tool_shed/test_data/emboss/emboss.tar Binary file test/tool_shed/test_data/emboss/emboss.tar has changed diff -r f1cb12e876c659c456c0b10f577494f79211b7f4 -r cf9cd1027e2a7e3f29201125fbbacf929ef55d0b test/tool_shed/test_data/freebayes/tool_dependencies.xml --- a/test/tool_shed/test_data/freebayes/tool_dependencies.xml +++ b/test/tool_shed/test_data/freebayes/tool_dependencies.xml @@ -3,13 +3,7 @@ <package name="freebayes" version="0.9.4_9696d0ce8a962f7bb61c4791be5ce44312b81cf8"><install version="1.0"><actions> - <action type="shell_command">git clone --recursive git://github.com/ekg/freebayes.git</action> - <action type="shell_command">git reset --hard 9696d0ce8a962f7bb61c4791be5ce44312b81cf8</action> - <action type="shell_command">make</action> - <action type="move_directory_files"> - <source_directory>bin</source_directory> - <destination_directory>$INSTALL_DIR/bin</destination_directory> - </action> + <action type="shell_command">echo "Success."</action><action type="set_environment"><environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable></action> @@ -23,17 +17,7 @@ <package name="samtools" version="0.1.18"><install version="1.0"><actions> - <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2</action> - <action type="shell_command">sed -i .bak -e 's/-lcurses/-lncurses/g' Makefile</action> - <action type="shell_command">make</action> - <action type="move_file"> - <source>samtools</source> - <destination>$INSTALL_DIR/bin</destination> - </action> - <action type="move_file"> - <source>misc/maq2sam-long</source> - <destination>$INSTALL_DIR/bin</destination> - </action> + <action type="shell_command">echo "Success."</action><action type="set_environment"><environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable></action> 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.
participants (1)
-
commits-noreply@bitbucket.org