[hg] galaxy 3235: Bug fixes: fix importing a history item to a l...
details: http://www.bx.psu.edu/hg/galaxy/rev/bfb0f6c64093 changeset: 3235:bfb0f6c64093 user: Greg Von Kuster <greg@bx.psu.edu> date: Wed Jan 13 18:02:37 2010 -0500 description: Bug fixes: fix importing a history item to a library, fix checking security on libraries from requests, send hid every time to functional test's verify_dataset_correctness() since we can now test multiple output datasets., and fix displaying info for library datasets in some scenarios. diffstat: lib/galaxy/web/controllers/library_common.py | 2 +- lib/galaxy/web/controllers/requests.py | 5 +++-- templates/library/common/common.mako | 4 ++-- test/functional/test_toolbox.py | 12 ++++++++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diffs (79 lines): diff -r 5239b3504ec4 -r bfb0f6c64093 lib/galaxy/web/controllers/library_common.py --- a/lib/galaxy/web/controllers/library_common.py Wed Jan 13 16:12:57 2010 -0500 +++ b/lib/galaxy/web/controllers/library_common.py Wed Jan 13 18:02:37 2010 -0500 @@ -911,7 +911,7 @@ dataset_names = [] created_ldda_ids = '' for hda_id in hda_ids: - hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( trans.security.decode_id( hda_id ) ) + hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( hda_id ) if hda: ldda = hda.to_library_dataset_dataset_association( target_folder=folder, replace_dataset=replace_dataset ) created_ldda_ids = '%s,%s' % ( created_ldda_ids, str( ldda.id ) ) diff -r 5239b3504ec4 -r bfb0f6c64093 lib/galaxy/web/controllers/requests.py --- a/lib/galaxy/web/controllers/requests.py Wed Jan 13 16:12:57 2010 -0500 +++ b/lib/galaxy/web/controllers/requests.py Wed Jan 13 18:02:37 2010 -0500 @@ -608,7 +608,7 @@ actions_to_check = [ trans.app.security_agent.permitted_actions.LIBRARY_ADD ] libraries = odict() for library in all_libraries: - can_show, hidden_folder_ids = trans.app.security_agent.show_library_item( user, roles, library, actions_to_check ) + can_show, hidden_folder_ids = trans.app.security_agent.show_library_item( trans.user, roles, library, actions_to_check ) if can_show: libraries[ library ] = hidden_folder_ids # create data library selectbox with refresh on change enabled @@ -661,7 +661,8 @@ else: folder_list.add_option('Select one', 'none') # get all show-able folders for the selected library - showable_folders = trans.app.security_agent.get_showable_folders( user, roles, + showable_folders = trans.app.security_agent.get_showable_folders( trans.user, + roles, selected_lib, actions_to_check, selected_hidden_folder_ids ) diff -r 5239b3504ec4 -r bfb0f6c64093 templates/library/common/common.mako --- a/templates/library/common/common.mako Wed Jan 13 16:12:57 2010 -0500 +++ b/templates/library/common/common.mako Wed Jan 13 18:02:37 2010 -0500 @@ -80,7 +80,7 @@ %if replace_dataset not in [ None, 'None' ]: <input type="hidden" name="replace_id" value="${trans.security.encode_id( replace_dataset.id )}"/> <div class="form-row"> - You are currently selecting a new file to replace '<a href="${h.url_for( controller=cntrller, action='ldda_display_info', library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${replace_dataset.name}</a>'. + You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_common', action='ldda_display_info', cntrller=cntrller, library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${replace_dataset.name}</a>'. <div style="clear: both"></div> </div> %endif @@ -302,7 +302,7 @@ %if replace_dataset not in [ None, 'None' ]: <input type="hidden" name="replace_id" value="${trans.security.encode_id( replace_dataset.id )}"/> <div class="form-row"> - You are currently selecting a new file to replace '<a href="${h.url_for( controller=cntrller, action='ldda_display_info', library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${replace_dataset.name}</a>'. + You are currently selecting a new file to replace '<a href="${h.url_for( controller='library_common', action='ldda_display_info', cntrller=cntrller, library_id=library_id, folder_id=folder_id, id=trans.security.encode_id( replace_dataset.library_dataset_dataset_association.id ) )}">${replace_dataset.name}</a>'. <div style="clear: both"></div> </div> %endif diff -r 5239b3504ec4 -r bfb0f6c64093 test/functional/test_toolbox.py --- a/test/functional/test_toolbox.py Wed Jan 13 16:12:57 2010 -0500 +++ b/test/functional/test_toolbox.py Wed Jan 13 18:02:37 2010 -0500 @@ -60,10 +60,18 @@ page_inputs = self.__expand_grouping(testdef.tool.inputs_by_page[i], all_inputs) self.submit_form( **page_inputs ) print "page_inputs (%i)" % i, page_inputs - # Check the results ( handles single or multiple tool outputs ) + # Check the results ( handles single or multiple tool outputs ). Make sure to pass the correct hid. + # The output datasets from the tool should be in the same order as the testdef.outputs. + data_list = self.get_history_as_data_list() + self.assertTrue( data_list ) + elem_index = 0 - len( testdef.outputs ) for output_tuple in testdef.outputs: name, file, sort = output_tuple - self.verify_dataset_correctness( file, maxseconds=testdef.maxseconds, sort=sort ) + # Get the correct hid + elem = data_list[ elem_index ] + elem_hid = elem.get( 'hid' ) + elem_index += 1 + self.verify_dataset_correctness( file, hid=elem_hid, maxseconds=testdef.maxseconds, sort=sort ) self.delete_history( id=self.security.encode_id( latest_history.id ) ) def __expand_grouping( self, tool_inputs, declared_inputs, prefix='' ):
participants (1)
-
Greg Von Kuster