Fix upload to respect explicit name override on pasted uploads.

This commit is contained in:
John Chilton
2016-12-31 10:02:48 -05:00
parent bb80c84277
commit 91c5b76667
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -320,12 +320,12 @@ class UploadDataset( Group ):
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']
+5 -5
View File
@@ -744,7 +744,7 @@ class ToolsTestCase( api.ApiTestCase ):
@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"] },
}
@@ -759,7 +759,7 @@ class ToolsTestCase( api.ApiTestCase ):
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 ):
@@ -784,8 +784,8 @@ class ToolsTestCase( api.ApiTestCase ):
@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"] },
@@ -803,7 +803,7 @@ class ToolsTestCase( api.ApiTestCase ):
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 ):