2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/4126ec15fd61/ Changeset: 4126ec15fd61 User: inithello Date: 2013-04-24 15:52:40 Summary: Fix functional test issue with forms having refresh_on_change. Affected #: 1 file diff -r fb28ceb83c379e1d792f622f9b2cbc8c3e050f37 -r 4126ec15fd614dff9d5a0b555623626fa947197c test/base/twilltestcase.py --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -1180,9 +1180,16 @@ # Check for refresh_on_change attribute, submit a change if required if hasattr( control, 'attrs' ) and 'refresh_on_change' in control.attrs.keys(): changed = False - item_labels = [ item.attrs[ 'label' ] for item in control.get_items() if item.selected ] #For DataToolParameter, control.value is the HDA id, but kwd contains the filename. This loop gets the filename/label for the selected values. + # For DataToolParameter, control.value is the HDA id, but kwd contains the filename. + # This loop gets the filename/label for the selected values. + item_labels = [ item.attrs[ 'label' ] for item in control.get_items() if item.selected ] for value in kwd[ control.name ]: - if value not in control.value and True not in [ value in item_label for item_label in item_labels ]: + # Galaxy truncates long file names in the dataset_collector in galaxy/tools/parameters/basic.py + if len( value ) > 30 and control.is_of_kind( 'singlelist' ): + field_value = '%s..%s' % ( elem[:17], elem[-11:] ) + else: + field_value = value + if field_value not in control.value and True not in [ field_value in item_label for item_label in item_labels ]: changed = True break if changed: @@ -1190,7 +1197,11 @@ control.clear() # kwd[control.name] should be a singlelist for elem in kwd[ control.name ]: - tc.fv( f.name, control.name, str( elem ) ) + if len( elem ) > 30 and control.is_of_kind( 'singlelist' ): + elem_name = '%s..%s' % ( elem[:17], elem[-11:] ) + else: + elem_name = elem + tc.fv( f.name, control.name, str( elem_name ) ) # Create a new submit control, allows form to refresh, instead of going to next page control = ClientForm.SubmitControl( 'SubmitControl', '___refresh_grouping___', {'name':'refresh_grouping'} ) control.add_to_form( f ) @@ -1241,7 +1252,7 @@ tc.fv( f.name, control.name, str( elem ) ) except Exception, e2: print "Attempting to set control '", control.name, "' to value '", elem, "' threw exception: ", e2 - # Galaxy truncates long file names in the dataset_collector in ~/parameters/basic.py + # Galaxy truncates long file names in the dataset_collector in galaxy/tools/parameters/basic.py if len( elem ) > 30: elem_name = '%s..%s' % ( elem[:17], elem[-11:] ) else: https://bitbucket.org/galaxy/galaxy-central/commits/b0ea9722b9dd/ Changeset: b0ea9722b9dd Branch: stable User: inithello Date: 2013-04-24 15:52:40 Summary: Fix functional test issue with forms having refresh_on_change. Affected #: 1 file diff -r ae53deed05b68f6febfcf3472c2a11514c12eb0c -r b0ea9722b9dd8e0da63208b59be20b90eae0cea7 test/base/twilltestcase.py --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -1180,9 +1180,16 @@ # Check for refresh_on_change attribute, submit a change if required if hasattr( control, 'attrs' ) and 'refresh_on_change' in control.attrs.keys(): changed = False - item_labels = [ item.attrs[ 'label' ] for item in control.get_items() if item.selected ] #For DataToolParameter, control.value is the HDA id, but kwd contains the filename. This loop gets the filename/label for the selected values. + # For DataToolParameter, control.value is the HDA id, but kwd contains the filename. + # This loop gets the filename/label for the selected values. + item_labels = [ item.attrs[ 'label' ] for item in control.get_items() if item.selected ] for value in kwd[ control.name ]: - if value not in control.value and True not in [ value in item_label for item_label in item_labels ]: + # Galaxy truncates long file names in the dataset_collector in galaxy/tools/parameters/basic.py + if len( value ) > 30 and control.is_of_kind( 'singlelist' ): + field_value = '%s..%s' % ( elem[:17], elem[-11:] ) + else: + field_value = value + if field_value not in control.value and True not in [ field_value in item_label for item_label in item_labels ]: changed = True break if changed: @@ -1190,7 +1197,11 @@ control.clear() # kwd[control.name] should be a singlelist for elem in kwd[ control.name ]: - tc.fv( f.name, control.name, str( elem ) ) + if len( elem ) > 30 and control.is_of_kind( 'singlelist' ): + elem_name = '%s..%s' % ( elem[:17], elem[-11:] ) + else: + elem_name = elem + tc.fv( f.name, control.name, str( elem_name ) ) # Create a new submit control, allows form to refresh, instead of going to next page control = ClientForm.SubmitControl( 'SubmitControl', '___refresh_grouping___', {'name':'refresh_grouping'} ) control.add_to_form( f ) @@ -1241,7 +1252,7 @@ tc.fv( f.name, control.name, str( elem ) ) except Exception, e2: print "Attempting to set control '", control.name, "' to value '", elem, "' threw exception: ", e2 - # Galaxy truncates long file names in the dataset_collector in ~/parameters/basic.py + # Galaxy truncates long file names in the dataset_collector in galaxy/tools/parameters/basic.py if len( elem ) > 30: elem_name = '%s..%s' % ( elem[:17], elem[-11:] ) else: 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.