Skip to content

Commit

Permalink
Fix upload to respect explicit name override on pasted uploads.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Dec 31, 2016
1 parent bb80c84 commit 91c5b76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/tools/parameters/grouping.py
Expand Up @@ -320,12 +320,12 @@ def get_url_paste_urls_or_filename( group_incoming, override_name=None, override
dataset_info = 'uploaded url'
yield Bunch( type='url', path=line, name=dataset_name )
else:
dataset_name = dataset_info = precreated_name = 'Pasted Entry' # we need to differentiate between various url pastes here
dataset_name = dataset_info = 'Pasted Entry' # we need to differentiate between various url pastes here
if override_name:
dataset_name = override_name
if override_info:
dataset_info = override_info
yield Bunch( type='file', path=url_paste_file, name=precreated_name )
yield Bunch( type='file', path=url_paste_file, name=dataset_name )

def get_one_filename( context ):
data_file = context['file_data']
Expand Down
10 changes: 5 additions & 5 deletions test/api/test_tools.py
Expand Up @@ -744,7 +744,7 @@ def test_identifier_in_map( self ):
@skip_without_tool( "identifier_single" )
def test_identifier_outside_map( self ):
history_id = self.dataset_populator.new_history()
new_dataset1 = self.dataset_populator.new_dataset( history_id, content='123' )
new_dataset1 = self.dataset_populator.new_dataset( history_id, content='123', name="Plain HDA" )
inputs = {
"input1": { 'src': 'hda', 'id': new_dataset1["id"] },
}
Expand All @@ -759,7 +759,7 @@ def test_identifier_outside_map( self ):
self.assertEquals( len( implicit_collections ), 0 )
output1 = outputs[ 0 ]
output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output1 )
self.assertEquals( output1_content.strip(), "Pasted Entry" )
self.assertEquals( output1_content.strip(), "Plain HDA" )

@skip_without_tool( "identifier_multiple" )
def test_identifier_in_multiple_reduce( self ):
Expand All @@ -784,8 +784,8 @@ def test_identifier_in_multiple_reduce( self ):
@skip_without_tool( "identifier_multiple" )
def test_identifier_with_multiple_normal_datasets( self ):
history_id = self.dataset_populator.new_history()
new_dataset1 = self.dataset_populator.new_dataset( history_id, content='123' )
new_dataset2 = self.dataset_populator.new_dataset( history_id, content='456' )
new_dataset1 = self.dataset_populator.new_dataset( history_id, content='123', name="Normal HDA1" )
new_dataset2 = self.dataset_populator.new_dataset( history_id, content='456', name="Normal HDA2" )
inputs = {
"input1": [
{ 'src': 'hda', 'id': new_dataset1["id"] },
Expand All @@ -803,7 +803,7 @@ def test_identifier_with_multiple_normal_datasets( self ):
self.assertEquals( len( implicit_collections ), 0 )
output1 = outputs[ 0 ]
output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output1 )
self.assertEquals( output1_content.strip(), "Pasted Entry\nPasted Entry" )
self.assertEquals( output1_content.strip(), "Normal HDA1\nNormal HDA2" )

@skip_without_tool( "identifier_collection" )
def test_identifier_with_data_collection( self ):
Expand Down

0 comments on commit 91c5b76

Please sign in to comment.