fix missing element_identifier with data_collection input parama

This commit is contained in:
Anthony Bretaudeau
2016-06-29 14:04:43 +02:00
parent 1d228d9a5c
commit fb116f5715
5 changed files with 22 additions and 36 deletions
+2 -2
View File
@@ -307,7 +307,7 @@ class DatasetListWrapper( list, ToolParameterValueWrapper, HasDatasets ):
element = dataset
dataset = element.dataset_instance
kwargs["identifier"] = element.element_identifier
return self._dataset_wrapper( dataset, dataset_paths, **kwargs )
return self._dataset_wrapper( dataset, dataset_paths, identifier = element_identifier, **kwargs )
list.__init__( self, map( to_wrapper, datasets ) )
self.job_working_directory = job_working_directory
@@ -365,7 +365,7 @@ class DatasetCollectionWrapper( ToolParameterValueWrapper, HasDatasets ):
if dataset_collection_element.is_collection:
element_wrapper = DatasetCollectionWrapper(job_working_directory, dataset_collection_element, dataset_paths, **kwargs )
else:
element_wrapper = self._dataset_wrapper( element_object, dataset_paths, **kwargs)
element_wrapper = self._dataset_wrapper( element_object, dataset_paths, identifier=element_identifier, **kwargs)
element_instances[element_identifier] = element_wrapper
element_instance_list.append( element_wrapper )
+4 -5
View File
@@ -806,8 +806,8 @@ class ToolsTestCase( api.ApiTestCase ):
output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output1 )
self.assertEquals( output1_content.strip(), "Pasted Entry\nPasted Entry" )
@skip_without_tool( "identifier_multiple_in_conditional" )
def test_identifier_with_multiple_normal_datasets_in_conditional( self ):
@skip_without_tool( "identifier_collection" )
def test_identifier_with_data_collection( self ):
history_id = self.dataset_populator.new_history()
element_identifiers = self.dataset_collection_populator.list_identifiers( history_id )
@@ -823,12 +823,11 @@ class ToolsTestCase( api.ApiTestCase ):
dataset_collection = create_response.json()
inputs = {
"options|choice": "one",
"options|input1": {'src': 'hdca', 'id': dataset_collection['id']},
"input1": {'src': 'hdca', 'id': dataset_collection['id']},
}
self.dataset_populator.wait_for_history( history_id, assert_ok=True )
create_response = self._run( "identifier_multiple_in_conditional", history_id, inputs )
create_response = self._run( "identifier_conditional", history_id, inputs )
self._assert_status_code_is( create_response, 200 )
create = create_response.json()
outputs = create[ 'outputs' ]
@@ -0,0 +1,15 @@
<tool id="identifier_conditional" name="identifier_conditional">
<command>
#for $input in $input1:
echo '$input.element_identifier' >> 'output1';
#end for
</command>
<inputs>
<param type="data_collection" collection_type="list" name="input1" label="Input 1" multiple="true" />
</inputs>
<outputs>
<data name="output1" type="tabular" from_work_dir="output1" />
</outputs>
<tests>
</tests>
</tool>
@@ -1,28 +0,0 @@
<tool id="identifier_multiple_in_conditional" name="identifier_multiple_in_conditional">
<command>
#if $options.choice == "one":
#for $input in $options.input1:
echo '$input.element_identifier' >> 'output1';
#end for
#end if
</command>
<inputs>
<conditional name="options">
<param name="choice" type="select" label="choice1">
<option value="one" selected="true">One</option>
<option value="two">Two</option>
</param>
<when value="one">
<param type="data_collection" collection_type="list" name="input1" label="Input 1" multiple="true" />
</when>
<when value="two">
<param type="data_collection" collection_type="list" name="input2" label="Input 2" multiple="true" />
</when>
</conditional>
</inputs>
<outputs>
<data name="output1" type="tabular" from_work_dir="output1" />
</outputs>
<tests>
</tests>
</tool>
+1 -1
View File
@@ -64,7 +64,7 @@
<tool file="validation_empty_dataset.xml" />
<tool file="identifier_single.xml" />
<tool file="identifier_multiple.xml" />
<tool file="identifier_multiple_in_conditional.xml" />
<tool file="identifier_conditional.xml" />
<tool file="tool_directory.xml" />
<tool file="output_action_change_format.xml" />
<tool file="collection_paired_test.xml" />