mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
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.
This commit is contained in:
@@ -911,7 +911,7 @@ class LibraryCommon( BaseController ):
|
||||
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 ) )
|
||||
|
||||
@@ -608,7 +608,7 @@ class Requests( BaseController ):
|
||||
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 @@ class Requests( BaseController ):
|
||||
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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -60,10 +60,18 @@ class ToolTestCase( TwillTestCase ):
|
||||
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='' ):
|
||||
|
||||
Reference in New Issue
Block a user