commit/galaxy-central: davebgx: Fix functional tests for library features.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/46f414686496/ Changeset: 46f414686496 User: davebgx Date: 2014-04-21 22:51:05 Summary: Fix functional tests for library features. Affected #: 2 files diff -r 646c971309f3fce14d5e95a709e9ca881e0ca0f0 -r 46f414686496939dab3337ec4301e41973b1af56 templates/webapps/galaxy/library/common/move_library_item.mako --- a/templates/webapps/galaxy/library/common/move_library_item.mako +++ b/templates/webapps/galaxy/library/common/move_library_item.mako @@ -67,7 +67,7 @@ <div class="toolFormBody"> %if target_library: <div class="form-row"> - %if len( target_folder_id_select_field.options ) > 1: + %if len( target_folder_id_select_field.options ) >= 1: ${target_folder_id_select_field.get_html()} %else: %if source_library and source_library.id == target_library.id: diff -r 646c971309f3fce14d5e95a709e9ca881e0ca0f0 -r 46f414686496939dab3337ec4301e41973b1af56 test/base/twilltestcase.py --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -194,6 +194,12 @@ file_dir = self.file_dir return os.path.abspath( os.path.join( file_dir, filename ) ) + def get_form_controls( self, form ): + formcontrols = [] + for i, control in enumerate( form.controls ): + formcontrols.append( "control %d: %s" % ( i, str( control ) ) ) + return formcontrols + def save_log( *path ): """Saves the log to a file""" filename = os.path.join( *path ) @@ -1234,11 +1240,9 @@ # To help with debugging a tool, print out the form controls when the test fails print "form '%s' contains the following controls ( note the values )" % f.name controls = {} - formcontrols = [] + formcontrols = self.get_form_controls( f ) hc_prefix = '<HiddenControl(' for i, control in enumerate( f.controls ): - formcontrols.append( "control %d: %s" % ( i, str( control ) ) ) - for i, control in enumerate( f.controls ): if not hc_prefix in str( control ): try: #check if a repeat element needs to be added @@ -1353,16 +1357,18 @@ pass tc.submit( button ) - def refresh_form( self, control_name, value, form_no=0, form_id=None, **kwd ): + def refresh_form( self, control_name, value, form_no=0, form_id=None, form_name=None, **kwd ): """Handles Galaxy's refresh_on_change for forms without ultimately submitting the form""" # control_name is the name of the form field that requires refresh_on_change, and value is # the value to which that field is being set. for i, f in enumerate( self.showforms() ): - if i == form_no or ( form_id is not None and f.id == form_id ): + if i == form_no or ( form_id is not None and f.id == form_id ) or ( form_name is not None and f.name == form_name ): break + formcontrols = self.get_form_controls( f ) try: control = f.find_control( name=control_name ) except: + log.debug( '\n'.join( formcontrols ) ) # This assumes we always want the first control of the given name, which may not be ideal... control = f.find_control( name=control_name, nr=0 ) # Check for refresh_on_change attribute, submit a change if required @@ -2534,13 +2540,22 @@ errmsg += 'Unpacked archive remains in: %s\n' % tmpd raise AssertionError( errmsg ) shutil.rmtree( tmpd ) + def move_library_item( self, cntrller, item_type, item_id, source_library_id, make_target_current, - target_library_id='', target_folder_id='', strings_displayed=[], strings_displayed_after_submit=[] ): + target_library_id=None, target_folder_id=None, strings_displayed=[], strings_displayed_after_submit=[] ): self.home() - self.visit_url( "%s/library_common/move_library_item?cntrller=%s&item_type=%s&item_id=%s&source_library_id=%s&make_target_current=%s" \ - % ( self.url, cntrller, item_type, item_id, source_library_id, make_target_current ) ) + params = dict( cntrller=cntrller, + item_type=item_type, + item_id=item_id, + source_library_id=source_library_id, + make_target_current=make_target_current ) + if target_library_id is not None: + params[ 'target_library_id' ] = target_library_id + if target_folder_id is not None: + params[ 'target_folder_id' ] = target_folder_id + self.visit_url( "%s/library_common/move_library_item?%s" % ( self.url, urllib.urlencode( params ) ) ) if target_library_id: - self.refresh_form( 'target_library_id', target_library_id ) + self.refresh_form( 'target_library_id', target_library_id, form_name='move_library_item' ) if target_folder_id: tc.fv( '1', 'target_folder_id', target_folder_id ) for check_str in strings_displayed: @@ -2549,6 +2564,7 @@ for check_str in strings_displayed_after_submit: self.check_page_for_string( check_str ) self.home() + def delete_library_item( self, cntrller, library_id, item_id, item_name, item_type='library_dataset' ): """Mark a library item as deleted""" self.home() 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