commit/galaxy-central: inithello: Update functional tests to account for the changes to when repositories can be uninstalled. Add tool panel section to tool API return value. Move test_db_util import to twilltestcase. Update tool test metadata generation.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/c2511b37db9b/ Changeset: c2511b37db9b User: inithello Date: 2013-12-14 05:07:07 Summary: Update functional tests to account for the changes to when repositories can be uninstalled. Add tool panel section to tool API return value. Move test_db_util import to twilltestcase. Update tool test metadata generation. Affected #: 69 files diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1075,6 +1075,22 @@ :returns: galaxy.jobs.JobDestination -- The destination definition and runner parameters. """ return self.app.job_config.get_destination(self.__get_job_tool_configuration(job_params=job_params).destination) + + def get_panel_section( self ): + for key, item in self.app.toolbox.integrated_tool_panel.items(): + if item: + if key.startswith( 'tool_' ): + if item.id == self.id: + return '', '' + if key.startswith( 'section_' ): + section_id = item.id or '' + section_name = item.name or '' + for section_key, section_item in item.elems.items(): + if section_key.startswith( 'tool_' ): + if section_item: + if section_item.id == self.id: + return section_id, section_name + return None, None def parse( self, root, guid=None ): """ @@ -3010,6 +3026,8 @@ if io_details: tool_dict[ 'inputs' ] = [ input.to_dict( trans ) for input in self.inputs.values() ] tool_dict[ 'outputs' ] = [ output.to_dict() for output in self.outputs.values() ] + + tool_dict[ 'panel_section_id' ], tool_dict[ 'panel_section_name' ] = self.get_panel_section() return tool_dict diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 lib/tool_shed/util/metadata_util.py --- a/lib/tool_shed/util/metadata_util.py +++ b/lib/tool_shed/util/metadata_util.py @@ -940,7 +940,12 @@ for required_file in ttb.required_files: value, extra = required_file required_files.append( ( value ) ) - inputs = [ input for input in ttb.inputs ] + inputs = [] + for input_field, values in ttb.inputs.iteritems(): + if len( values ) == 1: + inputs.append( ( input_field, values[0] ) ) + else: + inputs.append( ( input_field, values ) ) outputs = [] for output in ttb.outputs: name, file_name, extra = output diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -9,6 +9,7 @@ import time import tempfile import tarfile +import urllib import galaxy.webapps.tool_shed.util.hgweb_config import galaxy.model.tool_shed_install as galaxy_model import galaxy.util as util @@ -46,6 +47,7 @@ self.tool_shed_test_file = None self.tool_data_path = os.environ.get( 'GALAXY_TEST_TOOL_DATA_PATH' ) self.shed_tool_conf = os.environ.get( 'GALAXY_TEST_SHED_TOOL_CONF' ) + self.test_db_util = test_db_util # TODO: Figure out a way to alter these attributes during tests. self.galaxy_tool_dependency_dir = os.environ.get( 'GALAXY_TEST_TOOL_DEPENDENCY_DIR' ) self.shed_tools_dict = {} @@ -121,20 +123,17 @@ def check_galaxy_repository_tool_panel_section( self, repository, expected_tool_panel_section ): metadata = repository.metadata - assert 'tools' in metadata, 'Tools not found in metadata: %s' % metadata + assert 'tools' in metadata, 'Tools not found in repository metadata: %s' % metadata tool_metadata = metadata[ 'tools' ] # If integrated_tool_panel.xml is to be tested, this test method will need to be enhanced to handle tools # from the same repository in different tool panel sections. Getting the first tool guid is ok, because # currently all tools contained in a single repository will be loaded into the same tool panel section. - tool_guid = tool_metadata[ 0 ][ 'guid' ] - assert 'tool_panel_section' in metadata, 'Tool panel section not found in metadata: %s' % metadata - tool_panel_section_metadata = metadata[ 'tool_panel_section' ] - # tool_section_dict = dict( tool_config=guids_and_configs[ guid ], - # id=section_id, - # name=section_name, - # version=section_version ) - # This dict is appended to tool_panel_section_metadata[ tool_guid ] - tool_panel_section = tool_panel_section_metadata[ tool_guid ][ 0 ][ 'name' ] + if repository.status in [ galaxy_model.ToolShedRepository.installation_status.UNINSTALLED, + galaxy_model.ToolShedRepository.installation_status.DEACTIVATED ]: + tool_panel_section = self.get_tool_panel_section_from_repository_metadata( metadata ) + else: + log.debug( 'Status is %s' % repository.status ) + tool_panel_section = self.get_tool_panel_section_from_api( metadata ) assert tool_panel_section == expected_tool_panel_section, 'Expected to find tool panel section *%s*, but instead found *%s*\nMetadata: %s\n' % \ ( expected_tool_panel_section, tool_panel_section, metadata ) @@ -765,6 +764,28 @@ invalid_tools.append( dict( tools=repository_metadata.metadata[ 'invalid_tools' ], changeset_revision=repository_metadata.changeset_revision ) ) return valid_tools, invalid_tools + def get_tool_panel_section_from_api( self, metadata ): + tool_metadata = metadata[ 'tools' ] + tool_guid = urllib.quote_plus( tool_metadata[ 0 ][ 'guid' ], safe='' ) + api_url = '/%s' % '/'.join( [ 'api', 'tools', tool_guid ] ) + self.visit_galaxy_url( api_url ) + tool_dict = from_json_string( self.last_page() ) + tool_panel_section = tool_dict[ 'panel_section_name' ] + return tool_panel_section + + def get_tool_panel_section_from_repository_metadata( self, metadata ): + tool_metadata = metadata[ 'tools' ] + tool_guid = tool_metadata[ 0 ][ 'guid' ] + assert 'tool_panel_section' in metadata, 'Tool panel section not found in metadata: %s' % metadata + tool_panel_section_metadata = metadata[ 'tool_panel_section' ] + # tool_section_dict = dict( tool_config=guids_and_configs[ guid ], + # id=section_id, + # name=section_name, + # version=section_version ) + # This dict is appended to tool_panel_section_metadata[ tool_guid ] + tool_panel_section = tool_panel_section_metadata[ tool_guid ][ 0 ][ 'name' ] + return tool_panel_section + def grant_role_to_user( self, user, role ): strings_displayed = [ self.security.encode_id( role.id ), role.name ] strings_not_displayed = [] @@ -1049,11 +1070,13 @@ def reset_metadata_on_selected_repositories( self, repository_ids ): self.visit_url( '/admin/reset_metadata_on_selected_repositories_in_tool_shed' ) + log.debug( repository_ids ) kwd = dict( repository_ids=repository_ids ) self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd ) def reset_metadata_on_selected_installed_repositories( self, repository_ids ): self.visit_galaxy_url( '/admin_toolshed/reset_metadata_on_selected_installed_repositories' ) + log.debug( repository_ids ) kwd = dict( repository_ids=repository_ids ) self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd ) @@ -1173,16 +1196,15 @@ self.visit_url( url ) self.check_for_strings( strings_displayed, strings_not_displayed ) - def uninstall_repository( self, installed_repository, remove_from_disk=True ): + def uninstall_repository( self, installed_repository, remove_from_disk=True, is_required=False, strings_displayed=[], strings_not_displayed=[] ): url = '/admin_toolshed/deactivate_or_uninstall_repository?id=%s' % self.security.encode_id( installed_repository.id ) self.visit_galaxy_url( url ) - if remove_from_disk: - tc.fv ( 1, "remove_from_disk", 'true' ) - else: - tc.fv ( 1, "remove_from_disk", 'false' ) + self.check_for_strings( strings_displayed, strings_not_displayed ) + form = tc.browser.get_form( 'deactivate_or_uninstall_repository' ) + kwd = self.set_form_value( form, {}, 'remove_from_disk', remove_from_disk ) tc.submit( 'deactivate_or_uninstall_repository_button' ) strings_displayed = [ 'The repository named' ] - if remove_from_disk: + if remove_from_disk and not is_required: strings_displayed.append( 'has been uninstalled' ) else: strings_displayed.append( 'has been deactivated' ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0000_basic_repository_features.py --- a/test/tool_shed/functional/test_0000_basic_repository_features.py +++ b/test/tool_shed/functional/test_0000_basic_repository_features.py @@ -1,11 +1,8 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - repository_name = 'filtering_0000' repository_description = "Galaxy's filtering tool for test 0000" repository_long_description = "Long description of Galaxy's filtering tool for test 0000" - class TestBasicRepositoryFeatures( ShedTwillTestCase ): '''Test core repository features.''' @@ -13,19 +10,19 @@ """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) - test_user_2 = test_db_util.get_user( common.test_user_2_email ) + test_user_2 = self.test_db_util.get_user( common.test_user_2_email ) assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email - test_user_2_private_role = test_db_util.get_private_role( test_user_2 ) + test_user_2_private_role = self.test_db_util.get_private_role( test_user_2 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_categories( self ): """Create categories for this test suite""" @@ -36,7 +33,7 @@ """Create the filtering repository""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) + category = self.test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, 'Repository %s has been created' % "<b>%s</b>" % repository_name ] self.get_or_create_repository( name=repository_name, @@ -48,7 +45,7 @@ def test_0015_edit_repository( self ): """Edit the repository name, description, and long description""" - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) new_name = "renamed_filtering" new_description = "Edited filtering tool" new_long_description = "Edited long description" @@ -56,20 +53,20 @@ def test_0020_change_repository_category( self ): """Change the categories associated with the filtering repository""" - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.edit_repository_categories( repository, categories_to_add=[ "Test 0000 Basic Repository Features 2" ], categories_to_remove=[ "Test 0000 Basic Repository Features 1" ] ) def test_0025_grant_write_access( self ): '''Grant write access to another user''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.grant_write_access( repository, usernames=[ common.test_user_2_name ] ) self.revoke_write_access( repository, common.test_user_2_name ) def test_0030_upload_filtering_1_1_0( self ): """Upload filtering_1.1.0.tar to the repository""" - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='filtering/filtering_1.1.0.tar', filepath=None, @@ -82,7 +79,7 @@ def test_0035_verify_repository( self ): '''Display basic repository pages''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) latest_changeset_revision = self.get_repository_tip( repository ) self.check_for_valid_tools( repository, strings_displayed=[ 'Filter1' ] ) self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=1 ) @@ -106,7 +103,7 @@ def test_0040_alter_repository_states( self ): '''Test toggling the malicious and deprecated repository flags.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) self.set_repository_malicious( repository, @@ -132,7 +129,7 @@ def test_0045_display_repository_tip_file( self ): '''Display the contents of filtering.xml in the repository tip revision''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.display_repository_file_contents( repository=repository, filename='filtering.xml', filepath=None, @@ -141,7 +138,7 @@ def test_0050_upload_filtering_txt_file( self ): '''Upload filtering.txt file associated with tool version 1.1.0.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='filtering/filtering_0000.txt', filepath=None, @@ -155,7 +152,7 @@ def test_0055_upload_filtering_test_data( self ): '''Upload filtering test data.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='filtering/filtering_test_data.tar', filepath=None, @@ -174,7 +171,7 @@ def test_0060_upload_filtering_2_2_0( self ): '''Upload filtering version 2.2.0''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='filtering/filtering_2.2.0.tar', filepath=None, @@ -187,8 +184,8 @@ def test_0065_verify_filtering_repository( self ): '''Verify the new tool versions and repository metadata.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + category = self.test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) tip = self.get_repository_tip( repository ) self.check_for_valid_tools( repository ) strings_displayed = [ 'Select a revision' ] @@ -209,7 +206,7 @@ def test_0070_upload_readme_txt_file( self ): '''Upload readme.txt file associated with tool version 2.2.0.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='readme.txt', filepath=None, @@ -228,26 +225,26 @@ def test_0075_delete_readme_txt_file( self ): '''Delete the readme.txt file.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.delete_files_from_repository( repository, filenames=[ 'readme.txt' ] ) self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=2 ) self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] ) def test_0080_search_for_valid_filter_tool( self ): '''Search for the filtering tool by tool ID, name, and version.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) tip_changeset = self.get_repository_tip( repository ) search_fields = dict( tool_id='Filter1', tool_name='filter', tool_version='2.2.0' ) self.search_for_valid_tools( search_fields=search_fields, strings_displayed=[ tip_changeset ], strings_not_displayed=[] ) def test_0085_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.verify_unchanged_repository_metadata( repository ) def test_0090_verify_reserved_repository_name_handling( self ): '''Check that reserved repository names are handled correctly.''' - category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) + category = self.test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) error_message = 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a repository name.' self.get_or_create_repository( name='repos', description=repository_description, @@ -260,7 +257,7 @@ '''Check that reserved usernames are handled correctly.''' self.logout() self.login( email='baduser@bx.psu.edu', username='repos' ) - test_user_1 = test_db_util.get_user( 'baduser@bx.psu.edu' ) + test_user_1 = self.test_db_util.get_user( 'baduser@bx.psu.edu' ) assert test_user_1 is None, 'Creating user with public name "repos" succeeded.' error_message = 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a public user name.' self.check_for_strings( strings_displayed=[ error_message ] ) @@ -275,7 +272,7 @@ ''' self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) message = 'This is a test message.' strings_displayed = [ 'Contact the owner of the repository named', repository.name, 'streamline appropriate communication' ] post_submit_strings_displayed = [ 'An error occurred sending your message by email' ] @@ -286,25 +283,25 @@ def test_0110_delete_filtering_repository( self ): '''Delete the filtering_0000 repository and verify that it no longer has any downloadable revisions.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) self.delete_repository( repository ) # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag. for metadata_revision in repository.metadata_revisions: - test_db_util.refresh( metadata_revision ) + self.test_db_util.refresh( metadata_revision ) # Marking a repository as deleted should result in no metadata revisions being downloadable. assert True not in [ metadata.downloadable for metadata in repository.metadata_revisions ] def test_0115_undelete_filtering_repository( self ): '''Undelete the filtering_0000 repository and verify that it now has two downloadable revisions.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) self.undelete_repository( repository ) # Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag. for metadata_revision in repository.metadata_revisions: - test_db_util.refresh( metadata_revision ) + self.test_db_util.refresh( metadata_revision ) # Marking a repository as undeleted should result in all previously downloadable metadata revisions being downloadable again. # In this case, there should be two downloadable revisions, one for filtering 1.1.0 and one for filtering 2.2.0. assert True in [ metadata.downloadable for metadata in repository.metadata_revisions ] @@ -316,7 +313,7 @@ self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) # Get the repository, so we can pass the encoded repository id and browse_repositories method to the set_email_alerts method. - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) strings_displayed = [ 'Total alerts added: 1, total alerts removed: 0' ] self.enable_email_alerts( repository, strings_displayed=strings_displayed ) @@ -324,7 +321,7 @@ '''Upload a new readme file to the filtering_0000 repository and verify that there is no error.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) # Upload readme.txt to the filtering_0000 repository and verify that it is now displayed. self.upload_file( repository, filename='filtering/readme.txt', @@ -339,7 +336,7 @@ def test_0130_verify_handling_of_invalid_characters( self ): '''Load the above changeset in the change log and confirm that there is no server error displayed.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) changeset_revision = self.get_repository_tip( repository ) repository_id = self.security.encode_id( repository.id ) changelog_tuples = self.get_repository_changelog_tuples( repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py --- a/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py +++ b/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - repository_name = 'freebayes_0010' repository_description = "Galaxy's freebayes tool" repository_long_description = "Long description of Galaxy's freebayes tool" @@ -15,7 +13,6 @@ 7. Check for the appropriate strings on the manage repository page. ''' - class TestFreebayesRepository( ShedTwillTestCase ): '''Testing freebayes with tool data table entries, .loc files, and tool dependencies.''' @@ -23,14 +20,14 @@ """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" @@ -45,7 +42,7 @@ ''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0010 Repository With Tool Dependencies' ) + category = self.test_db_util.get_category_by_name( 'Test 0010 Repository With Tool Dependencies' ) repository = self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, @@ -72,7 +69,7 @@ We are at step 2 - Upload the tool_data_table_conf.xml.sample file. Uploading the tool_data_table_conf.xml.sample alone should not make the tool valid, but the error message should change. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='freebayes/tool_data_table_conf.xml.sample', filepath=None, @@ -93,7 +90,7 @@ We are at step 3 - Upload the tool_data_table_conf.xml.sample file. Uploading the tool_data_table_conf.xml.sample alone should not make the tool valid, but the error message should change. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='freebayes/sam_fa_indices.loc.sample', filepath=None, @@ -110,7 +107,7 @@ We are at step 4 - Upload a tool_dependencies.xml file that should not parse correctly. Upload a tool_dependencies.xml file that contains <> in the text of the readme tag. This should show an error message about malformed xml. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename=os.path.join( 'freebayes', 'malformed_tool_dependencies', 'tool_dependencies.xml' ), filepath=None, @@ -127,7 +124,7 @@ We are at step 5 - Upload a tool_dependencies.xml file that specifies a version that does not match the tool's requirements. This should result in a message about the tool dependency configuration not matching the tool's requirements. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename=os.path.join( 'freebayes', 'invalid_tool_dependencies', 'tool_dependencies.xml' ), filepath=None, @@ -144,7 +141,7 @@ We are at step 6 - Upload a valid tool_dependencies.xml file. At this stage, there should be no errors on the upload page, as every missing or invalid file has been corrected. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename=os.path.join( 'freebayes', 'tool_dependencies.xml' ), filepath=None, @@ -161,7 +158,7 @@ We are at step 7 - Check for the appropriate strings on the manage repository page. Verify that the manage repository page now displays the valid tool dependencies, and that there are no invalid tools shown on the manage page. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) strings_displayed = [ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Valid tools', 'package' ] strings_not_displayed = [ 'Invalid tools' ] self.display_manage_repository_page( repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0020_basic_repository_dependencies.py --- a/test/tool_shed/functional/test_0020_basic_repository_dependencies.py +++ b/test/tool_shed/functional/test_0020_basic_repository_dependencies.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - datatypes_repository_name = 'emboss_datatypes_0020' datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." @@ -9,7 +7,6 @@ emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020' emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020' - class TestBasicRepositoryDependencies( ShedTwillTestCase ): '''Testing emboss 5 with repository dependencies.''' @@ -17,14 +14,14 @@ """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" @@ -34,7 +31,7 @@ '''Create and populate the emboss_datatypes repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) + category = self.test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) repository = self.get_or_create_repository( name=datatypes_repository_name, description=datatypes_repository_description, long_description=datatypes_repository_long_description, @@ -53,12 +50,12 @@ def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' - repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) self.display_manage_repository_page( repository, strings_displayed=[ 'Datatypes', 'equicktandem', 'hennig86', 'vectorstrip' ] ) def test_0020_create_emboss_5_repository_and_upload_files( self ): '''Create and populate the emboss_5_0020 repository.''' - category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) + category = self.test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) repository = self.get_or_create_repository( name=emboss_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, @@ -77,16 +74,16 @@ def test_0025_generate_and_upload_repository_dependencies_xml( self ): '''Generate and upload the repository_dependencies.xml file''' - repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0020', additional_paths=[ 'emboss', '5' ] ) repository_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) self.create_repository_dependency( repository=repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) def test_0030_verify_emboss_5_dependencies( self ): '''Verify that the emboss_5 repository now depends on the emboss_datatypes repository with correct name, owner, and changeset revision.''' - repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) changeset_revision = self.get_repository_tip( datatypes_repository ) strings_displayed = [ 'Tool dependencies', 'emboss', @@ -100,7 +97,7 @@ def test_0040_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) self.verify_unchanged_repository_metadata( emboss_repository ) self.verify_unchanged_repository_metadata( datatypes_repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0030_repository_dependency_revisions.py --- a/test/tool_shed/functional/test_0030_repository_dependency_revisions.py +++ b/test/tool_shed/functional/test_0030_repository_dependency_revisions.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - datatypes_repository_name = 'emboss_datatypes_0030' datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." @@ -11,7 +9,6 @@ emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030' emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030' - class TestRepositoryDependencyRevisions( ShedTwillTestCase ): '''Test dependencies on different revisions of a repository.''' @@ -19,14 +16,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" @@ -36,7 +33,7 @@ '''Create and populate the emboss_5_0030 repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + category = self.test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) repository = self.get_or_create_repository( name=emboss_5_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, @@ -56,7 +53,7 @@ '''Create and populate the emboss_6_0030 repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + category = self.test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) repository = self.get_or_create_repository( name=emboss_6_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, @@ -76,7 +73,7 @@ '''Create and populate the emboss_datatypes_0030 repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + category = self.test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) repository = self.get_or_create_repository( name=datatypes_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, @@ -96,7 +93,7 @@ '''Create and populate the emboss_0030 repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + category = self.test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) repository = self.get_or_create_repository( name=emboss_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, @@ -114,41 +111,41 @@ def test_0030_generate_repository_dependencies_for_emboss_5( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_5 repository.''' - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss5' ] ) datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) self.create_repository_dependency( repository=emboss_5_repository, repository_tuples=[ datatypes_tuple ], filepath=repository_dependencies_path ) def test_0035_generate_repository_dependencies_for_emboss_6( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_6 repository.''' - emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss6' ] ) datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) self.create_repository_dependency( repository=emboss_6_repository, repository_tuples=[ datatypes_tuple ], filepath=repository_dependencies_path ) def test_0040_generate_repository_dependency_on_emboss_5( self ): '''Create and upload repository_dependencies.xml for the emboss_5_0030 repository.''' - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss', '5' ] ) emboss_tuple = ( self.url, emboss_5_repository.name, emboss_5_repository.user.username, self.get_repository_tip( emboss_5_repository ) ) self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ emboss_tuple ], filepath=repository_dependencies_path ) def test_0045_generate_repository_dependency_on_emboss_6( self ): '''Create and upload repository_dependencies.xml for the emboss_6_0030 repository.''' - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss', '5' ] ) emboss_tuple = ( self.url, emboss_6_repository.name, emboss_6_repository.user.username, self.get_repository_tip( emboss_6_repository ) ) self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ emboss_tuple ], filepath=repository_dependencies_path ) def test_0050_verify_repository_dependency_revisions( self ): '''Verify that different metadata revisions of the emboss repository have different repository dependencies.''' - repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) repository_metadata = [ ( metadata.metadata, metadata.changeset_revision ) for metadata in self.get_repository_metadata( repository ) ] - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) datatypes_tip = self.get_repository_tip( datatypes_repository ) strings_displayed = [] # Iterate through all metadata revisions and check for repository dependencies. @@ -161,9 +158,9 @@ strings_displayed=strings_displayed ) def test_0055_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) - emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) + emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) for repository in [ emboss_repository, emboss_5_repository, emboss_6_repository, datatypes_repository ]: self.verify_unchanged_repository_metadata( repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0040_repository_circular_dependencies.py --- a/test/tool_shed/functional/test_0040_repository_circular_dependencies.py +++ b/test/tool_shed/functional/test_0040_repository_circular_dependencies.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - freebayes_repository_name = 'freebayes_0040' freebayes_repository_description = "Galaxy's freebayes tool for test 0040" freebayes_repository_long_description = "Long description of Galaxy's freebayes tool for test 0040" @@ -9,7 +7,6 @@ filtering_repository_description = "Galaxy's filtering tool for test 0040" filtering_repository_long_description = "Long description of Galaxy's filtering tool for test 0040" - class TestRepositoryCircularDependencies( ShedTwillTestCase ): '''Verify that the code correctly displays repositories with circular repository dependencies.''' @@ -17,14 +14,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" @@ -76,8 +73,8 @@ # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. # Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes. - repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0040', additional_paths=[ 'filtering' ] ) repository_tuple = ( self.url, repository.name, repository.user.username, self.get_repository_tip( repository ) ) self.create_repository_dependency( repository=filtering_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) @@ -88,16 +85,16 @@ # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. # Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes. - repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0040', additional_paths=[ 'freebayes' ] ) repository_tuple = ( self.url, repository.name, repository.user.username, self.get_repository_tip( repository ) ) self.create_repository_dependency( repository=freebayes_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) def test_0030_verify_repository_dependencies( self ): '''Verify that each repository can depend on the other without causing an infinite loop.''' - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) # The dependency structure should look like: # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. @@ -108,14 +105,14 @@ def test_0035_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) for repository in [ freebayes_repository, filtering_repository ]: self.verify_unchanged_repository_metadata( repository ) def test_0040_verify_tool_dependencies( self ): '''Verify that freebayes displays tool dependencies.''' - repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) self.display_manage_repository_page( repository, strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Valid tools', 'package' ], strings_not_displayed=[ 'Invalid tools' ] ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py --- a/test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py +++ b/test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - emboss_datatypes_repository_name = 'emboss_datatypes_0050' emboss_datatypes_repository_description = "Datatypes for emboss" emboss_datatypes_repository_long_description = "Long description of Emboss' datatypes" @@ -32,7 +30,6 @@ category_name = 'Test 0050 Circular Dependencies 5 Levels' category_description = 'Test circular dependency features' - class TestRepositoryCircularDependenciesToNLevels( ShedTwillTestCase ): '''Verify that the code correctly handles circular dependencies down to n levels.''' @@ -40,14 +37,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_convert_repository( self ): '''Create and populate convert_chars_0050.''' @@ -187,13 +184,13 @@ strings_not_displayed=[] ) def test_0040_create_and_upload_dependency_definitions( self ): - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + bismark_repository = self.test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) dependency_xml_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] ) # convert_chars depends on column_maker # column_maker depends on convert_chars @@ -235,13 +232,13 @@ id: 7 key: http://toolshed.local:10001__ESEP__emboss_5__ESEP__test__ESEP__8de5fe0d7b04 ['http://toolshed.local:10001', 'emboss_datatypes', 'test', 'dbd4f68bf507'] ''' - emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) - bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) + emboss_datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + bismark_repository = self.test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) self.check_repository_dependency( convert_repository, column_repository ) self.check_repository_dependency( column_repository, convert_repository ) self.check_repository_dependency( emboss_datatypes_repository, bismark_repository ) @@ -256,17 +253,17 @@ def test_0050_verify_tool_dependencies( self ): '''Check that freebayes and emboss display tool dependencies.''' - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) self.display_manage_repository_page( freebayes_repository, strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Tool dependencies', 'package' ] ) self.display_manage_repository_page( emboss_repository, strings_displayed=[ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] ) def test_0055_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' - emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + emboss_datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) for repository in [ emboss_datatypes_repository, emboss_repository, freebayes_repository, filtering_repository ]: self.verify_unchanged_repository_metadata( repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0060_workflows.py --- a/test/tool_shed/functional/test_0060_workflows.py +++ b/test/tool_shed/functional/test_0060_workflows.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - repository_name = 'filtering_0060' repository_description="Galaxy's filtering tool for test 0060" repository_long_description="Long description of Galaxy's filtering tool for test 0060" @@ -15,20 +13,21 @@ workflow_repository_description="Workflow referencing the filtering tool for test 0060" workflow_repository_long_description="Long description of the workflow for test 0060" + class TestToolShedWorkflowFeatures( ShedTwillTestCase ): '''Test valid and invalid workflows.''' def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_categories( self ): """Create categories for this test suite""" self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features' ) @@ -45,7 +44,7 @@ strings_displayed=[] ) def test_0015_upload_workflow( self ): '''Upload a workflow with a missing tool, and verify that the tool specified is marked as missing.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) workflow = file( self.get_filename( 'filtering_workflow/Workflow_for_0060_filter_workflow_repository.ga' ), 'r' ).read() workflow = workflow.replace( '__TEST_TOOL_SHED_URL__', self.url.replace( 'http://', '' ) ) workflow_filepath = self.generate_temp_path( 'test_0060', additional_paths=[ 'filtering_workflow' ] ) @@ -64,7 +63,7 @@ self.load_workflow_image_in_tool_shed( repository, workflow_name, strings_displayed=[ '#EBBCB2' ] ) def test_0020_upload_tool( self ): '''Upload the missing tool for the workflow in the previous step, and verify that the error is no longer present.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, filename='filtering/filtering_2.2.0.tar', filepath=None, @@ -94,7 +93,7 @@ if not os.path.exists( workflow_filepath ): os.makedirs( workflow_filepath ) file( os.path.join( workflow_filepath, workflow_filename ), 'w+' ).write( workflow ) - repository = test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name ) self.upload_file( repository, filename=workflow_filename, filepath=workflow_filepath, @@ -107,11 +106,11 @@ self.load_workflow_image_in_tool_shed( repository, workflow_name, strings_displayed=[ '#EBBCB2' ] ) def test_0030_check_workflow_repository( self ): """Check for strings on the manage page for the filtering_workflow_0060 repository.""" - repository = test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name ) strings_displayed = [ 'Workflows', 'New workflow for 0060_filter', '0.1' ] strings_not_displayed = [ 'Valid tools', 'Invalid tools' ] self.display_manage_repository_page( repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed ) def test_0035_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.verify_unchanged_repository_metadata( repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0070_invalid_tool.py --- a/test/tool_shed/functional/test_0070_invalid_tool.py +++ b/test/tool_shed/functional/test_0070_invalid_tool.py @@ -1,13 +1,10 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - repository_name = 'bismark_0070' repository_description = "Galaxy's bismark wrapper" repository_long_description = "Long description of Galaxy's bismark wrapper" category_name = 'Test 0070 Invalid Tool Revisions' category_description = 'Tests for a repository with invalid tool revisions.' - class TestBismarkRepository( ShedTwillTestCase ): '''Testing bismark with valid and invalid tool entries.''' @@ -15,14 +12,14 @@ """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_category_and_repository( self ): """Create a category for this test suite, then create and populate a bismark repository. It should contain at least one each valid and invalid tool.""" @@ -56,7 +53,7 @@ strings_displayed=[], strings_not_displayed=[] ) valid_revision = self.get_repository_tip( repository ) - test_db_util.refresh( repository ) + self.test_db_util.refresh( repository ) tool_guid = '%s/repos/user1/bismark_0070/bismark_methylation_extractor/0.7.7.3' % self.url.replace( 'http://', '' ).rstrip( '/' ) tool_metadata_strings_displayed = [ tool_guid, '0.7.7.3', # The tool version. diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0080_advanced_circular_dependencies.py --- a/test/tool_shed/functional/test_0080_advanced_circular_dependencies.py +++ b/test/tool_shed/functional/test_0080_advanced_circular_dependencies.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - column_repository_name = 'column_maker_0080' column_repository_description = "Add column" column_repository_long_description = "Compute an expression on every row" @@ -12,7 +10,6 @@ category_name = 'Test 0080 Advanced Circular Dependencies' category_description = 'Test circular dependency features' - class TestRepositoryCircularDependencies( ShedTwillTestCase ): '''Verify that the code correctly handles circular dependencies.''' @@ -20,14 +17,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_column_repository( self ): """Create and populate the column_maker repository.""" @@ -75,30 +72,30 @@ def test_0020_create_repository_dependencies( self ): '''Upload a repository_dependencies.xml file that specifies the current revision of convert_chars_0080 to the column_maker_0080 repository.''' - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0080', additional_paths=[ 'convert' ] ) repository_tuple = ( self.url, convert_repository.name, convert_repository.user.username, self.get_repository_tip( convert_repository ) ) self.create_repository_dependency( repository=column_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) def test_0025_create_dependency_on_filtering( self ): '''Upload a repository_dependencies.xml file that specifies the current revision of filtering to the freebayes_0040 repository.''' - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0080', additional_paths=[ 'convert' ] ) repository_tuple = ( self.url, column_repository.name, column_repository.user.username, self.get_repository_tip( column_repository ) ) self.create_repository_dependency( repository=convert_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) def test_0030_verify_repository_dependencies( self ): '''Verify that each repository can depend on the other without causing an infinite loop.''' - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) self.check_repository_dependency( convert_repository, column_repository, self.get_repository_tip( column_repository ) ) self.check_repository_dependency( column_repository, convert_repository, self.get_repository_tip( convert_repository ) ) def test_0035_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) for repository in [ column_repository, convert_repository ]: self.verify_unchanged_repository_metadata( repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0090_tool_search.py --- a/test/tool_shed/functional/test_0090_tool_search.py +++ b/test/tool_shed/functional/test_0090_tool_search.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - emboss_datatypes_repository_name = 'emboss_datatypes_0090' emboss_datatypes_repository_description = "Datatypes for emboss" emboss_datatypes_repository_long_description = "Long description of Emboss' datatypes" @@ -28,7 +26,6 @@ category_name = 'Test 0090 Tool Search And Installation' category_description = 'Test 0090 Tool Search And Installation' - class TestRepositoryCircularDependenciesAgain( ShedTwillTestCase ): '''Test more features related to repository dependencies.''' @@ -36,14 +33,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_bwa_base_repository( self ): '''Create and populate bwa_base_0090.''' @@ -167,12 +164,12 @@ def test_0035_create_and_upload_dependency_definitions( self ): '''Create and upload repository dependency definitions.''' - bwa_color_repository = test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name ) - bwa_base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + bwa_color_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name ) + bwa_base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) dependency_xml_path = self.generate_temp_path( 'test_0090', additional_paths=[ 'freebayes' ] ) freebayes_tuple = ( self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip( freebayes_repository ) ) emboss_tuple = ( self.url, emboss_repository.name, emboss_repository.user.username, self.get_repository_tip( emboss_repository ) ) @@ -185,12 +182,12 @@ def test_0040_verify_repository_dependencies( self ): '''Verify the generated dependency structure.''' - bwa_color_repository = test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name ) - bwa_base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) - emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + bwa_color_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name ) + bwa_base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + emboss_datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) self.check_repository_dependency( emboss_repository, emboss_datatypes_repository ) self.check_repository_dependency( filtering_repository, freebayes_repository ) self.check_repository_dependency( bwa_base_repository, emboss_repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0100_complex_repository_dependencies.py --- a/test/tool_shed/functional/test_0100_complex_repository_dependencies.py +++ b/test/tool_shed/functional/test_0100_complex_repository_dependencies.py @@ -1,5 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util import logging log = logging.getLogger( __name__ ) @@ -15,7 +14,6 @@ category_name = 'Test 0100 Complex Repository Dependencies' category_description = 'Test 0100 Complex Repository Dependencies' - class TestComplexRepositoryDependencies( ShedTwillTestCase ): '''Test features related to complex repository dependencies.''' @@ -23,14 +21,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_bwa_package_repository( self ): '''Create and populate package_bwa_0_5_9_0100.''' @@ -84,9 +82,9 @@ dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) # The repository named bwa_base_repository_0100 is the dependent repository. - base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) # The repository named package_bwa_0_5_9_0100 is the required repository. - tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) url = 'http://http://this is not an url!' name = 'package_bwa_0_5_9_0100' owner = 'user1' @@ -107,9 +105,9 @@ dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) # The base_repository named bwa_base_repository_0100 is the dependent repository. - base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) # The repository named package_bwa_0_5_9_0100 is the required repository. - tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) url = self.url name = 'invalid_repository!?' owner = 'user1' @@ -130,9 +128,9 @@ dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) # The base_repository named bwa_base_repository_0100 is the dependent repository. - base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) # The repository named package_bwa_0_5_9_0100 is the required repository. - tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) url = self.url name = 'package_bwa_0_5_9_0100' owner = 'invalid_owner!?' @@ -152,9 +150,9 @@ dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) # The base_repository named bwa_base_repository_0100 is the dependent repository. - base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) # The repository named package_bwa_0_5_9_0100 is the required repository. - tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) url = self.url name = 'package_bwa_0_5_9_0100' owner = 'user1' @@ -172,9 +170,9 @@ def test_0035_generate_complex_repository_dependency( self ): '''Generate and upload a valid tool_dependencies.xml file that specifies package_bwa_0_5_9_0100.''' # The base_repository named bwa_base_repository_0100 is the dependent repository. - base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) # The repository named package_bwa_0_5_9_0100 is the required repository. - tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex' ] ) url = self.url name = 'package_bwa_0_5_9_0100' @@ -193,9 +191,9 @@ def test_0040_generate_tool_dependency( self ): '''Generate and upload a new tool_dependencies.xml file that specifies an arbitrary file on the filesystem, and verify that bwa_base depends on the new changeset revision.''' # The base_repository named bwa_base_repository_0100 is the dependent repository. - base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) # The repository named package_bwa_0_5_9_0100 is the required repository. - tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) previous_changeset = self.get_repository_tip( tool_repository ) old_tool_dependency = self.get_filename( os.path.join( 'bwa', 'complex', 'readme', 'tool_dependencies.xml' ) ) new_tool_dependency_path = self.generate_temp_path( 'test_1100', additional_paths=[ 'tool_dependency' ] ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py --- a/test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py +++ b/test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - datatypes_repository_name = 'emboss_datatypes_0110' datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." @@ -12,7 +10,6 @@ category_name = 'Test 0110 Invalid Repository Dependencies' category_desc = 'Test 0110 Invalid Repository Dependencies' - class TestBasicRepositoryDependencies( ShedTwillTestCase ): '''Testing emboss 5 with repository dependencies.''' @@ -20,14 +17,14 @@ """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" @@ -37,7 +34,7 @@ '''Create and populate the emboss_datatypes repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - category = test_db_util.get_category_by_name( category_name ) + category = self.test_db_util.get_category_by_name( category_name ) repository = self.get_or_create_repository( name=datatypes_repository_name, description=datatypes_repository_description, long_description=datatypes_repository_long_description, @@ -56,12 +53,12 @@ def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' - repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) self.display_manage_repository_page( repository, strings_displayed=[ 'Datatypes', 'equicktandem', 'hennig86', 'vectorstrip' ] ) def test_0020_create_emboss_5_repository_and_upload_files( self ): '''Create and populate the emboss_5_0110 repository.''' - category = test_db_util.get_category_by_name( category_name ) + category = self.test_db_util.get_category_by_name( category_name ) repository = self.get_or_create_repository( name=emboss_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, @@ -82,8 +79,8 @@ '''Generate a repository dependency for emboss 5 with an invalid URL.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) url = 'http://http://this is not an url!' name = datatypes_repository.name owner = datatypes_repository.user.username @@ -100,8 +97,8 @@ '''Generate a repository dependency for emboss 5 with an invalid name.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path ) - repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) url = self.url name = '!?invalid?!' owner = repository.user.username @@ -118,8 +115,8 @@ '''Generate a repository dependency for emboss 5 with an invalid owner.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path ) - repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) url = self.url name = repository.name owner = '!?invalid?!' @@ -136,8 +133,8 @@ '''Generate a repository dependency for emboss 5 with an invalid changeset revision.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple', 'invalid' ] ) xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path ) - repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) url = self.url name = repository.name owner = repository.user.username diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py --- a/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py +++ b/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - datatypes_repository_name = 'blast_datatypes_0120' datatypes_repository_description = 'Galaxy applicable datatypes for BLAST' datatypes_repository_long_description = 'Galaxy datatypes for the BLAST top hit descriptons tool' @@ -23,7 +21,6 @@ base_datatypes_count = 0 repository_datatypes_count = 0 - class TestRepositoryMultipleOwners( ShedTwillTestCase ): def test_0000_initiate_users( self ): @@ -34,19 +31,19 @@ """ self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) - test_user_2 = test_db_util.get_user( common.test_user_1_email ) + test_user_2 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email - test_user_2_private_role = test_db_util.get_private_role( test_user_2 ) + test_user_2_private_role = self.test_db_util.get_private_role( test_user_2 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_datatypes_repository( self ): """Create and populate the blast_datatypes_0120 repository""" @@ -83,7 +80,7 @@ the datatypes that are defined in datatypes_conf.xml. ''' global repository_datatypes_count - repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name ) strings_displayed = [ 'BlastXml', 'BlastNucDb', 'BlastProtDb', 'application/xml', 'text/html', 'blastxml', 'blastdbn', 'blastdbp'] self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) repository_datatypes_count = int( self.get_repository_datatypes_count( repository ) ) @@ -121,7 +118,7 @@ We are at step 2a. Check for appropriate strings, such as tool name, description, and version. ''' - repository = test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name ) strings_displayed = [ 'blastxml_to_top_descr_0120', 'BLAST top hit descriptions', 'Make a table from BLAST XML' ] strings_displayed.extend( [ '0.0.1', 'Valid tools'] ) self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) @@ -132,8 +129,8 @@ We are at step 3. Create a simple repository dependency for blastxml_to_top_descr_0120 that defines a dependency on blast_datatypes_0120. ''' - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name ) - tool_repository = test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name ) dependency_xml_path = self.generate_temp_path( 'test_0120', additional_paths=[ 'dependencies' ] ) datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) self.create_repository_dependency( repository=tool_repository, repository_tuples=[ datatypes_tuple ], filepath=dependency_xml_path ) @@ -144,6 +141,6 @@ We are at step 3a. Check the newly created repository dependency to ensure that it was defined and displays correctly. ''' - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name ) - tool_repository = test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name ) + tool_repository = self.test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name ) self.check_repository_dependency( tool_repository, datatypes_repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0130_datatype_converters.py --- a/test/tool_shed/functional/test_0130_datatype_converters.py +++ b/test/tool_shed/functional/test_0130_datatype_converters.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - repository_name = 'bed_to_gff_0130' repository_description = "Converter: BED to GFF" repository_long_description = "Convert bed to gff" @@ -14,7 +12,6 @@ 3) Visit the view tool metadata page and make sure that "Display in tool panel" is False ''' - class TestDatatypeConverters( ShedTwillTestCase ): '''Test features related to datatype converters.''' @@ -22,14 +19,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_bed_to_gff_repository( self ): '''Create and populate bed_to_gff_0130.''' @@ -64,7 +61,7 @@ We are at step 2 - Visit the manage repository page and make sure there is the appropriate valid tool and datatype. There should be a 'Convert BED to GFF' tool and a 'galaxy.datatypes.interval:Bed' datatype with extension 'bed' ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) strings_displayed = [ 'Convert BED to GFF', 'galaxy.datatypes.interval:Bed', 'bed', 'Valid tools', 'Datatypes' ] strings_not_displayed = [ 'Invalid tools' ] self.display_manage_repository_page( repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed ) @@ -75,7 +72,7 @@ We are at step 3 Datatype converters that are associated with a datatype should have display in tool panel = False in the tool metadata. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) metadata = self.get_repository_metadata_by_changeset_revision( repository, self.get_repository_tip( repository ) ) tool_metadata_strings_displayed = '<label>Display in tool panel:</label>\n False' self.check_repository_tools_for_changeset_revision( repository, diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0140_tool_help_images.py --- a/test/tool_shed/functional/test_0140_tool_help_images.py +++ b/test/tool_shed/functional/test_0140_tool_help_images.py @@ -1,5 +1,6 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util + + import logging log = logging.getLogger(__name__) @@ -20,7 +21,6 @@ ''' - class TestToolHelpImages( ShedTwillTestCase ): '''Test features related to tool help images.''' @@ -28,14 +28,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_htseq_count_repository( self ): '''Create and populate htseq_count_0140.''' @@ -73,7 +73,7 @@ src="/repository/static/images/<id>/count_modes.png" ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) # Get the repository tip. changeset_revision = self.get_repository_tip( repository ) self.display_manage_repository_page( repository ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0150_prior_installation_required.py --- a/test/tool_shed/functional/test_0150_prior_installation_required.py +++ b/test/tool_shed/functional/test_0150_prior_installation_required.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - column_repository_name = 'column_maker_0150' column_repository_description = "Add column" column_repository_long_description = "Compute an expression on every row" @@ -26,7 +24,6 @@ Verify that convert_chars was installed first, contrary to the ordering that would be present without prior_installation_required. ''' - class TestSimplePriorInstallation( ShedTwillTestCase ): '''Test features related to datatype converters.''' @@ -34,14 +31,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_convert_repository( self ): '''Create and populate convert_chars_0150.''' @@ -89,8 +86,8 @@ Column maker repository dependency: <repository toolshed="self.url" name="convert_chars" owner="test" changeset_revision="<tip>" prior_installation_required="True" /> ''' - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) dependency_xml_path = self.generate_temp_path( 'test_0150', additional_paths=[ 'column' ] ) convert_tuple = ( self.url, convert_repository.name, convert_repository.user.username, self.get_repository_tip( convert_repository ) ) self.create_repository_dependency( repository=column_repository, @@ -100,8 +97,8 @@ def test_0020_verify_repository_dependency( self ): '''Verify that the previously generated repositiory dependency displays correctly.''' - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) self.check_repository_dependency( repository=column_repository, depends_on_repository=convert_repository, depends_on_changeset_revision=None, diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0160_circular_prior_installation_required.py --- a/test/tool_shed/functional/test_0160_circular_prior_installation_required.py +++ b/test/tool_shed/functional/test_0160_circular_prior_installation_required.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - filter_repository_name = 'filtering_0160' filter_repository_description = "Galaxy's filtering tool for test 0160" filter_repository_long_description = "Long description of Galaxy's filtering tool for test 0160" @@ -25,7 +23,6 @@ Verify display. ''' - class TestSimplePriorInstallation( ShedTwillTestCase ): '''Test features related to datatype converters.''' @@ -33,14 +30,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_convert_repository( self ): '''Create and populate convert_chars_0160.''' @@ -106,9 +103,9 @@ ''' Each of the three repositories should depend on the other two, to make this as circular as possible. ''' - filter_repository = test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name ) - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + filter_repository = self.test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) dependency_xml_path = self.generate_temp_path( 'test_0160', additional_paths=[ 'column' ] ) filter_revision = self.get_repository_tip( filter_repository ) column_revision = self.get_repository_tip( column_repository ) @@ -131,9 +128,9 @@ def test_0025_verify_repository_dependency( self ): '''Verify that the previously generated repositiory dependency displays correctly.''' - filter_repository = test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name ) - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + filter_repository = self.test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) self.check_repository_dependency( repository=column_repository, depends_on_repository=convert_repository, depends_on_changeset_revision=None, diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0170_complex_prior_installation_required.py --- a/test/tool_shed/functional/test_0170_complex_prior_installation_required.py +++ b/test/tool_shed/functional/test_0170_complex_prior_installation_required.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - matplotlib_repository_name = 'package_matplotlib_1_2_0170' matplotlib_repository_description = "Contains a tool dependency definition that downloads and compiles version 1.2.x of the the python matplotlib package." matplotlib_repository_long_description = "This repository is intended to be defined as a complex repository dependency within a separate repository." @@ -18,7 +16,6 @@ 3. Verify that package_matplotlib_1_2_0170 now depends on package_numpy_1_7_0170, and that the inherited tool dependency displays correctly. ''' - class TestComplexPriorInstallation( ShedTwillTestCase ): '''Test features related to datatype converters.''' @@ -26,14 +23,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_matplotlib_repository( self ): '''Create and populate the package_matplotlib_1_2_0170 repository.''' @@ -91,8 +88,8 @@ set to True. When matplotlib is selected for installation, the result should be that numpy is compiled and installed first. ''' - numpy_repository = test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name ) - matplotlib_repository = test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name ) + numpy_repository = self.test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name ) + matplotlib_repository = self.test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name ) # Generate the new dependency XML. Normally, the create_repository_dependency method would be used for this, but # it replaces any existing tool or repository dependency XML file with the generated contents. This is undesirable # in this case, because matplotlib already has an additional tool dependency definition that we don't want to @@ -128,8 +125,8 @@ 'Inhherited' in this case means that matplotlib should show a package tool dependency on numpy version 1.7, and a repository dependency on the latest revision of package_numpy_1_7_0170. ''' - numpy_repository = test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name ) - matplotlib_repository = test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name ) + numpy_repository = self.test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name ) + matplotlib_repository = self.test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name ) changeset_revision = self.get_repository_tip( numpy_repository ) self.check_repository_dependency( matplotlib_repository, depends_on_repository=numpy_repository ) self.display_manage_repository_page( matplotlib_repository, strings_displayed=[ 'numpy', '1.7', 'package', changeset_revision ] ) diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0300_reset_all_metadata.py --- a/test/tool_shed/functional/test_0300_reset_all_metadata.py +++ b/test/tool_shed/functional/test_0300_reset_all_metadata.py @@ -1,6 +1,4 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - datatypes_repository_name = 'emboss_datatypes_0020' datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." @@ -41,6 +39,7 @@ running_standalone = False + class TestResetAllRepositoryMetadata( ShedTwillTestCase ): '''Verify that the "Reset selected metadata" feature works.''' @@ -48,14 +47,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_filtering_repository( self ): '''Create and populate the filtering_0000 repository.''' @@ -298,10 +297,10 @@ '''Create the dependency structure for test 0030.''' global running_standalone if running_standalone: - datatypes_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_datatypes_0030', common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_0030', common.test_user_1_name ) - emboss_5_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_5_0030', common.test_user_1_name ) - emboss_6_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_6_0030', common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_datatypes_0030', common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_0030', common.test_user_1_name ) + emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_5_0030', common.test_user_1_name ) + emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_6_0030', common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss' ] ) datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) emboss_5_tuple = ( self.url, emboss_5_repository.name, emboss_5_repository.user.username, self.get_repository_tip( emboss_5_repository ) ) @@ -365,8 +364,8 @@ '''Create the dependency structure for test 0040.''' global running_standalone if running_standalone: - freebayes_repository = test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0340', additional_paths=[ 'dependencies' ] ) freebayes_tuple = ( self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip( freebayes_repository ) ) filtering_tuple = ( self.url, filtering_repository.name, filtering_repository.user.username, self.get_repository_tip( filtering_repository ) ) @@ -554,13 +553,13 @@ if running_standalone: self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) - convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) + column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + bismark_repository = self.test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) dependency_xml_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] ) # convert_chars depends on column_maker # column_maker depends on convert_chars @@ -629,7 +628,7 @@ self.login( email=common.admin_email, username=common.admin_username ) old_metadata = dict() new_metadata = dict() - repositories = test_db_util.get_all_repositories() + repositories = self.test_db_util.get_all_repositories() for repository in repositories: old_metadata[ self.security.encode_id( repository.id ) ] = dict() for metadata in self.get_repository_metadata( repository ): diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0310_hg_push_from_api.py --- a/test/tool_shed/functional/test_0310_hg_push_from_api.py +++ b/test/tool_shed/functional/test_0310_hg_push_from_api.py @@ -1,5 +1,6 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util + + import logging log = logging.getLogger( __name__ ) @@ -22,7 +23,6 @@ 5. Verify that the changesets have been applied. ''' - class TestHgWebFeatures( ShedTwillTestCase ): '''Test http mercurial interface.''' @@ -30,19 +30,19 @@ """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) + test_user_1 = self.test_db_util.get_user( common.test_user_1_email ) assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) - test_user_2 = test_db_util.get_user( common.test_user_2_email ) + test_user_2 = self.test_db_util.get_user( common.test_user_2_email ) assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email - test_user_2_private_role = test_db_util.get_private_role( test_user_2 ) + test_user_2_private_role = self.test_db_util.get_private_role( test_user_2 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) + admin_user = self.test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) + admin_user_private_role = self.test_db_util.get_private_role( admin_user ) def test_0005_create_filtering_repository( self ): '''Create and populate the filtering_0310 repository.''' @@ -98,7 +98,7 @@ We will be prepending a comment to filtering.py. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) clone_path = self.generate_temp_path( 'test_0310', additional_paths=[ 'filtering_0310', 'user2' ] ) self.clone_repository( repository, clone_path ) hgrepo = self.get_hg_repo( clone_path ) @@ -133,7 +133,7 @@ We will be prepending a second comment to filtering.py. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) clone_path = self.generate_temp_path( 'test_0310', additional_paths=[ 'filtering_0310', 'user1' ] ) self.clone_repository( repository, clone_path ) hgrepo = self.get_hg_repo( clone_path ) @@ -161,7 +161,7 @@ The commit from test_user_2 should not be present in the changelog, since the repositories were cloned to separate locations. ''' - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) strings_displayed = [ 'Uploaded filtering 1.1.0.', 'Uploaded filtering test data.', 'Added another line to filtering.py.' ] strings_not_displayed = [ 'Added a line to filtering.py' ] This diff is so big that we needed to truncate the remainder. 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