commit/galaxy-central: Dave Bouvier: Update test 0450 to also verify the list of testable revisions returned by the repository_revisions tool shed API controller.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/6bbd8f133650/ Changeset: 6bbd8f133650 User: Dave Bouvier Date: 2013-12-04 14:41:23 Summary: Update test 0450 to also verify the list of testable revisions returned by the repository_revisions tool shed API controller. Affected #: 3 files diff -r 1ef1ec8346f176e050099767679e6df9effe28e5 -r 6bbd8f13365063ee960969dea82c2b1ed2a6d6ae test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -616,7 +616,7 @@ if not os.path.exists( temp_path ): os.makedirs( temp_path ) return temp_path - + def get_datatypes_count( self ): url = '/api/datatypes?upload_only=false' self.visit_galaxy_url( url ) @@ -887,23 +887,6 @@ log.debug( 'Waiting for the installation of repository IDs: %s' % str( repository_ids ) ) self.wait_for_repository_installation( repository_ids ) - def set_form_value( self, form, kwd, field_name, field_value ): - ''' - Set the form field field_name to field_value if it exists, and return the provided dict containing that value. If - the field does not exist in the provided form, return a dict without that index. - ''' - form_id = form.attrs.get( 'id' ) - controls = [ control for control in form.controls if str( control.name ) == field_name ] - if len( controls ) > 0: - log.debug( 'Setting field %s of form %s to %s.' % ( field_name, form_id, str( field_value ) ) ) - tc.formvalue( form_id, field_name, str( field_value ) ) - kwd[ field_name ] = str( field_value ) - else: - if field_name in kwd: - log.debug( 'No field %s in form %s, discarding from return value.' % ( str( control ), str( form_id ) ) ) - del( kwd[ field_name ] ) - return kwd - def load_citable_url( self, username, repository_name, @@ -941,6 +924,17 @@ self.visit_url( url ) self.check_for_strings( strings_displayed, strings_not_displayed ) + def load_checkable_revisions( self, strings_displayed=[], strings_not_displayed=[] ): + params = urllib.urlencode( dict( do_not_test='false', + downloadable='true', + includes_tools='true', + malicious='false', + missing_test_components='false', + skip_tool_test='false' ) ) + api_url = '%s?%s' % ( '/'.join( [ self.url, 'api', 'repository_revisions' ] ), params ) + self.visit_url( api_url ) + self.check_for_strings( strings_displayed, strings_not_displayed ) + def load_display_tool_page( self, repository, tool_xml_path, changeset_revision, strings_displayed=[], strings_not_displayed=[] ): url = '/repository/display_tool?repository_id=%s&tool_config=%s&changeset_revision=%s' % \ ( self.security.encode_id( repository.id ), tool_xml_path, changeset_revision ) @@ -1104,6 +1098,23 @@ tc.submit() self.check_for_strings( post_submit_strings_displayed, post_submit_strings_not_displayed ) + def set_form_value( self, form, kwd, field_name, field_value ): + ''' + Set the form field field_name to field_value if it exists, and return the provided dict containing that value. If + the field does not exist in the provided form, return a dict without that index. + ''' + form_id = form.attrs.get( 'id' ) + controls = [ control for control in form.controls if str( control.name ) == field_name ] + if len( controls ) > 0: + log.debug( 'Setting field %s of form %s to %s.' % ( field_name, form_id, str( field_value ) ) ) + tc.formvalue( form_id, field_name, str( field_value ) ) + kwd[ field_name ] = str( field_value ) + else: + if field_name in kwd: + log.debug( 'No field %s in form %s, discarding from return value.' % ( str( control ), str( form_id ) ) ) + del( kwd[ field_name ] ) + return kwd + def set_repository_deprecated( self, repository, set_deprecated=True, strings_displayed=[], strings_not_displayed=[] ): url = '/repository/deprecate?id=%s&mark_deprecated=%s' % ( self.security.encode_id( repository.id ), set_deprecated ) self.visit_url( url ) @@ -1116,21 +1127,25 @@ self.check_for_strings( strings_displayed, strings_not_displayed ) def set_skip_tool_tsts_flag( self, repository, flag_value, reason, changeset_revision=None ): - ''' - NOTE: As with certain other methods in this test suite, the form can't easily be filled out, so we're emulating the - form's expected behavior with url parameters, in particular the checkbox behavior. - ''' if changeset_revision is None: changeset_revision = self.get_repository_tip( repository ) self.display_manage_repository_page( repository, changeset_revision=changeset_revision ) - params = 'skip_tool_tests=true&%s' % ( urllib.urlencode( dict( changeset_revision=changeset_revision, - id=self.security.encode_id( repository.id ), - skip_tool_tests=str( flag_value ), - skip_tool_tests_comment=reason, - skip_tool_tests_button='Save' ) ) ) - url = '/repository/manage_repository?%s' % params - self.visit_url( url ) - self.check_for_strings( strings_displayed=[ 'Tools in this revision', 'automated test framework' ] ) + form = tc.browser.get_form( 'skip_tool_tests' ) + assert form is not None, 'Could not find form skip_tool_tests.' + for control in form.controls: + control_name = str( control.name ) + if control_name == 'skip_tool_tests' and control.type == 'checkbox': + checkbox = control.get() + checkbox.selected = flag_value + elif control_name == 'skip_tool_tests_comment': + tc.browser.clicked( form, control ) + tc.formvalue( 'skip_tool_tests', control_name, reason ) + kwd = dict() + self.submit_form( 'skip_tool_tests', 'skip_tool_tests_button', **kwd ) + if flag_value is True: + self.check_for_strings( strings_displayed=[ 'Tools in this revision will not be tested by the automated test framework' ] ) + else: + self.check_for_strings( strings_displayed=[ 'Tools in this revision will be tested by the automated test framework' ] ) def tip_has_metadata( self, repository ): tip = self.get_repository_tip( repository ) diff -r 1ef1ec8346f176e050099767679e6df9effe28e5 -r 6bbd8f13365063ee960969dea82c2b1ed2a6d6ae test/tool_shed/functional/test_0450_skip_tool_tests.py --- a/test/tool_shed/functional/test_0450_skip_tool_tests.py +++ b/test/tool_shed/functional/test_0450_skip_tool_tests.py @@ -131,6 +131,7 @@ ''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.display_manage_repository_page( repository, strings_displayed=[ 'Skip reason for first revision.' ] ) + self.load_checkable_revisions( strings_not_displayed=[ self.get_repository_tip( repository ) ] ) def test_0025_upload_new_tool_version( self ): '''Upload filtering 2.2.0.''' @@ -156,6 +157,7 @@ should not be checked and the reason should be empty. ''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + self.load_checkable_revisions( strings_displayed=[ self.get_repository_tip( repository ) ] ) self.display_manage_repository_page( repository, strings_not_displayed=[ 'Skip reason for first revision.' ] ) def test_0045_verify_previous_revision_skip_setting( self ): @@ -166,6 +168,7 @@ ''' global first_metadata_revision repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + self.load_checkable_revisions( strings_not_displayed=[ first_metadata_revision ] ) self.display_manage_repository_page( repository, changeset_revision=first_metadata_revision, strings_displayed=[ 'Skip reason for first revision.' ] ) @@ -177,6 +180,7 @@ ''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.set_skip_tool_tsts_flag( repository=repository, flag_value=True, reason='Skip reason for second revision.' ) + self.load_checkable_revisions( strings_not_displayed=[ self.get_repository_tip( repository ) ] ) self.display_manage_repository_page( repository, strings_displayed=[ 'Skip reason for second revision.' ] ) def test_0060_upload_another_readme_file( self ): @@ -198,6 +202,7 @@ strings_not_displayed=[] ) self.display_manage_repository_page( repository, strings_displayed=[ 'Skip reason for second revision.' ] ) + self.load_checkable_revisions( strings_not_displayed=[ self.get_repository_tip( repository ) ] ) def test_0065_verify_skip_setting_on_first_changeset( self ): '''Verify that the first changeset only displays its own skip reason.''' @@ -232,6 +237,7 @@ self.display_manage_repository_page( repository, changeset_revision=first_metadata_revision, strings_not_displayed=[ 'Skip reason for second revision.', 'Skip reason for first revision.' ] ) + self.load_checkable_revisions( strings_displayed=[ first_metadata_revision ] ) def test_0075_unset_skip_setting_on_second_revision( self ): '''Set the second revision not to skip tests, verify setting.''' @@ -242,7 +248,5 @@ self.set_skip_tool_tsts_flag( repository=repository, flag_value=False, reason='' ) self.display_manage_repository_page( repository, strings_not_displayed=[ 'Skip reason for second revision.', 'Skip reason for first revision.' ] ) + self.load_checkable_revisions( strings_displayed=[ self.get_repository_tip( repository ) ] ) - - - \ No newline at end of file diff -r 1ef1ec8346f176e050099767679e6df9effe28e5 -r 6bbd8f13365063ee960969dea82c2b1ed2a6d6ae test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py --- a/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py +++ b/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py @@ -6,7 +6,7 @@ bwa_base_repository_long_description = "BWA tool that depends on bwa 0.5.9, with a complex repository dependency pointing at package_bwa_0_5_9_0100" bwa_package_repository_name = 'package_bwa_0_5_9_0100' -bwa_package_repository_description = "BWA Tool" +bwa_package_repository_description = "BWA Package" bwa_package_repository_long_description = "BWA repository with a package tool dependency defined to compile and install BWA 0.5.9." category_name = 'Test 0100 Complex Repository Dependencies' @@ -31,7 +31,7 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_bwa_package_repository( self ): - '''Create and populate bwa_tool_0100.''' + '''Create and populate package_bwa_0_5_9_0100.''' global running_standalone category = self.create_category( name=category_name, description=category_description ) self.logout() 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