commit/galaxy-central: Dave Bouvier: Update functional tests to reflect recent interface upgrades and enhancements.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/036f57f93b23/ Changeset: 036f57f93b23 User: Dave Bouvier Date: 2013-05-15 19:44:53 Summary: Update functional tests to reflect recent interface upgrades and enhancements. Affected #: 4 files diff -r 93013dcdc4a558791743839d90262e713aba66fd -r 036f57f93b23a62205b8541b6fd773561879827e 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,6 +1,7 @@ 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__) 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" @@ -342,8 +343,16 @@ repository = 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 ) + revision_number = -1 + revision_hash = '000000000000' + for numeric_changeset, changeset_hash in changelog_tuples: + if str( changeset_hash ) == str( changeset_revision ): + revision_number = numeric_changeset + revision_hash = changeset_hash + break # Check for the changeset revision, repository name, owner username, 'repos' in the clone url, and the captured # unicode decoding error message. - strings_displayed = [ 'Changeset %s' % changeset_revision, 'filtering_0000', 'user1', 'repos', 'added:', + strings_displayed = [ 'Changeset %d:%s' % ( revision_number, revision_hash ), 'filtering_0000', 'user1', 'repos', 'added:', 'Error decoding string:', "codec can't decode byte" ] self.load_changeset_in_tool_shed( repository_id, changeset_revision, strings_displayed=strings_displayed ) \ No newline at end of file diff -r 93013dcdc4a558791743839d90262e713aba66fd -r 036f57f93b23a62205b8541b6fd773561879827e test/tool_shed/functional/test_0420_citable_urls_for_repositories.py --- a/test/tool_shed/functional/test_0420_citable_urls_for_repositories.py +++ b/test/tool_shed/functional/test_0420_citable_urls_for_repositories.py @@ -148,9 +148,6 @@ test_user_1 = test_db_util.get_user( common.test_user_1_email ) encoded_user_id = self.security.encode_id( test_user_1.id ) encoded_repository_id = self.security.encode_id( repository.id ) - # We are checking the changeset revision pointed to by first_changeset_hash, stored in a global variable at the end of - # test_0005. The tip changeset hash should not be displayed here, but first_changeset_hash should. - tip_changeset_hash = self.get_repository_tip( repository ) # Since twill does not load the contents of an iframe, we need to check that the iframe has been generated correctly, # then directly load the url that the iframe should be loading and check for the expected strings. # The iframe should point to /repository/view_repository?id=<encoded repository ID> @@ -158,7 +155,7 @@ strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420', first_changeset_hash ] strings_displayed_in_iframe.append( 'Sharable link to this repository revision:' ) strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420/%s' % ( self.url, first_changeset_hash ) ) - strings_not_displayed_in_iframe = [ tip_changeset_hash ] + strings_not_displayed_in_iframe = [] self.load_citable_url( username='user1', repository_name='filtering_0420', changeset_revision=first_changeset_hash, @@ -173,20 +170,20 @@ test_user_1 = test_db_util.get_user( common.test_user_1_email ) encoded_user_id = self.security.encode_id( test_user_1.id ) encoded_repository_id = self.security.encode_id( repository.id ) - changeset_hash = '!!invalid!!' + invalid_changeset_hash = 'invalid' tip_revision = self.get_repository_tip( repository ) # Since twill does not load the contents of an iframe, we need to check that the iframe has been generated correctly, # then directly load the url that the iframe should be loading and check for the expected strings. # The iframe should point to /repository/view_repository?id=<encoded repository ID>&status=error strings_displayed = [ '/repository', 'view_repository', 'id=' + encoded_repository_id ] - strings_displayed.extend( [ 'The+change+log', 'does+not+include+revision', '%21%21invalid%21%21', 'status=error' ] ) + strings_displayed.extend( [ 'The+change+log', 'does+not+include+revision', invalid_changeset_hash, 'status=error' ] ) strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420' ] strings_displayed_in_iframe.append( 'Sharable link to this repository revision:' ) - strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420/%s' % ( self.url, changeset_hash ) ) - strings_not_displayed_in_iframe = [ tip_revision ] + strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420/%s' % ( self.url, invalid_changeset_hash ) ) + strings_not_displayed_in_iframe = [] self.load_citable_url( username='user1', repository_name='filtering_0420', - changeset_revision=changeset_hash, + changeset_revision=invalid_changeset_hash, encoded_user_id=encoded_user_id, encoded_repository_id=encoded_repository_id, strings_displayed=strings_displayed, diff -r 93013dcdc4a558791743839d90262e713aba66fd -r 036f57f93b23a62205b8541b6fd773561879827e test/tool_shed/functional/test_1090_install_tool_from_tool_search.py --- a/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py +++ b/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py @@ -296,7 +296,7 @@ exact_matches=False, from_galaxy=True, strings_displayed=[ 'bwa_color_0090', 'bwa_base_0090', bwa_base_revision, bwa_color_revision ] ) strings_displayed=[ 'freebayes_0090', 'emboss_0090', 'filtering_0090' ] - strings_displayed.extend( [ 'bwa_color_0090', 'bwa_base_0090', 'emboss_datatypes_0090' ] ) + strings_displayed.extend( [ 'bwa_color_0090', 'bwa_base_0090' ] ) strings_displayed.extend( [ 'bwa', 'Handle', 'tool dependencies' ] ) repositories_to_install = [ bwa_color_repository, bwa_base_repository ] # BWA is a good candidate for testing the installation of tool dependencies, but it is a core requirement of functional diff -r 93013dcdc4a558791743839d90262e713aba66fd -r 036f57f93b23a62205b8541b6fd773561879827e test/tool_shed/functional/test_1300_reset_all_metadata.py --- a/test/tool_shed/functional/test_1300_reset_all_metadata.py +++ b/test/tool_shed/functional/test_1300_reset_all_metadata.py @@ -400,5 +400,14 @@ for repository in repositories: test_db_util.ga_refresh( repository ) old_metadata = repository_metadata[ self.security.encode_id( repository.id ) ] - assert repository.metadata == old_metadata, 'Metadata for installed repository %s changed after reset.' % repository.name + # When a repository with tools to be displayed in a tool panel section is deactivated and reinstalled, + # the tool panel section remains in the repository metadata. However, when the repository's metadata + # is subsequently reset, the tool panel section is removed from the repository metadata. While this + # is normal and expected behavior, the functional tests assume that repository metadata will not change + # in any way after a reset. A workaround is to remove the tool panel section from the stored repository + # metadata dict, in order to eliminate the misleading detection of changed metadata. + if 'tool_panel_section' in old_metadata and 'tool_panel_section' not in repository.metadata: + del old_metadata[ 'tool_panel_section' ] + assert repository.metadata == old_metadata, 'Metadata for %s repository %s changed after reset. \nOld: %s\nNew: %s' % \ + ( repository.status, repository.name, old_metadata, repository.metadata ) \ No newline at end of file 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