commit/galaxy-central: inithello: Added tool shed functional test features for tool metadata.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/1d078ed70cb8/ changeset: 1d078ed70cb8 user: inithello date: 2012-11-21 22:32:17 summary: Added tool shed functional test features for tool metadata. affected #: 2 files diff -r 7d278a17747ad9cb35b1af5ec011e46f814c339a -r 1d078ed70cb8faf207c6367761a683bf6d9c3e68 test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -30,6 +30,11 @@ if strings_not_displayed: for string in strings_not_displayed: self.check_string_not_in_page( string ) + def check_for_tool_metadata(self, repository, changeset_revision, tool_id, strings_displayed=[], strings_not_displayed=[] ): + url = '/repository/view_tool_metadata?repository_id=%s&changeset_revision=%s&tool_id=%s' % \ + ( self.security.encode_id( repository.id ), changeset_revision, tool_id ) + self.visit_url( url ) + self.check_for_strings( strings_displayed, strings_not_displayed ) def check_for_valid_tools( self, repository ): self.manage_repository( repository ) self.check_page_for_string( '<b>Valid tools</b><i> - click the name to preview the tool' ) @@ -118,6 +123,14 @@ tc.fv( "3", "allow_push", '+%s' % username ) tc.submit( 'user_access_button' ) self.check_for_strings( strings_displayed, strings_not_displayed ) + def load_display_tool_page( self, repository, tool_xml_filename, changeset_revision, strings_displayed=[], strings_not_displayed=[] ): + repository_id = self.security.encode_id( repository.id ) + repo_subdirectory = '%03d' % int( repository.id / 1000 ) + tool_xml_path = '%2f'.join( [ 'database', 'community_files', repo_subdirectory, 'repo_%d' % repository.id, tool_xml_filename ] ) + url = '/repository/display_tool?repository_id=%s&tool_config=%s&changeset_revision=%s' % \ + ( repository_id, tool_xml_path, changeset_revision ) + self.visit_url( url ) + self.check_for_strings( strings_displayed, strings_not_displayed ) def manage_repository( self, repository, strings_displayed=[], strings_not_displayed=[] ): url = '/repository/manage_repository?id=%s' % self.security.encode_id( repository.id ) self.visit_url( url ) diff -r 7d278a17747ad9cb35b1af5ec011e46f814c339a -r 1d078ed70cb8faf207c6367761a683bf6d9c3e68 test/tool_shed/functional/test_0000_create_repository.py --- a/test/tool_shed/functional/test_0000_create_repository.py +++ b/test/tool_shed/functional/test_0000_create_repository.py @@ -69,11 +69,18 @@ strings_displayed=[ "The file '%s' has been successfully uploaded to the repository." % filter_filename ], \ commit_message="Uploaded filtering 1.1.0" ) self.check_for_valid_tools( repository ) - latest_changeset_revision = self.get_latest_repository_metadata_for_repository( repository ) + latest_repository_metadata = self.get_latest_repository_metadata_for_repository( repository ) + changeset_revision = latest_repository_metadata.changeset_revision self.check_repository_changelog( repository, strings_displayed=[ 'Repository metadata is associated with this change set.' ] ) self.set_repository_malicious( repository, strings_displayed=[ 'The repository tip has been defined as malicious.' ] ) self.unset_repository_malicious( repository, strings_displayed=[ 'The repository tip has been defined as <b>not</b> malicious.' ] ) -# self.check_tool_metadata( repository, latest_changeset_revision, strings_displayed=[ 'Filter1' ] ) + self.load_display_tool_page( repository, tool_xml_filename='filtering.xml', \ + changeset_revision=changeset_revision, \ + strings_displayed=[ 'Filter (version 1.1.0)', "c1=='chr1'" ], \ + strings_not_displayed=[] ) + tool = latest_repository_metadata.metadata[ 'tools' ][0] + metadata_strings_displayed = [ tool[ 'guid' ], tool[ 'version' ], tool[ 'id' ], tool[ 'name' ], tool[ 'description' ], changeset_revision ] + self.check_for_tool_metadata( repository, changeset_revision, 'Filter1', strings_displayed=metadata_strings_displayed ) def test_0035_repository_browse_page( self ): '''Visit the repository browse page''' repository = get_repository_by_name( repository_name, admin_username ) 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)
-
Bitbucket