From c2b091d207197759e9693b6d5bf3581a678043ee Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 22 Apr 2016 09:18:52 -0400 Subject: [PATCH] Tests demonstrating multi-data params in repeats are broken. A test cases and a tool that can be tested directory. --- test/api/test_tools.py | 32 +++++++++++++++++++++ test/functional/tools/multi_data_repeat.xml | 13 +++++++++ test/functional/tools/samples_tool_conf.xml | 1 + 3 files changed, 46 insertions(+) create mode 100644 test/functional/tools/multi_data_repeat.xml diff --git a/test/api/test_tools.py b/test/api/test_tools.py index ec79d07f971..dfcd5ef50f9 100644 --- a/test/api/test_tools.py +++ b/test/api/test_tools.py @@ -931,6 +931,38 @@ class ToolsTestCase( api.ApiTestCase ): } self._check_simple_reduce_job( history_id, inputs ) + @skip_without_tool( "multi_data_repeat" ) + def test_reduce_collections_in_repeat( self ): + history_id = self.dataset_populator.new_history() + hdca1_id = self.__build_pair( history_id, [ "123", "456" ] ) + inputs = { + "outer_repeat_0|f1": { 'src': 'hdca', 'id': hdca1_id }, + } + create = self._run( "multi_data_repeat", history_id, inputs, assert_ok=True ) + outputs = create[ 'outputs' ] + jobs = create[ 'jobs' ] + self.assertEquals( len( jobs ), 1 ) + self.assertEquals( len( outputs ), 1 ) + output1 = outputs[0] + output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output1 ) + assert output1_content.strip() == "123\n456", output1_content + + @skip_without_tool( "multi_data_repeat" ) + def test_reduce_collections_in_repeat_legacy( self ): + history_id = self.dataset_populator.new_history() + hdca1_id = self.__build_pair( history_id, [ "123", "456" ] ) + inputs = { + "outer_repeat_0|f1": "__collection_reduce__|%s" % hdca1_id, + } + create = self._run( "multi_data_repeat", history_id, inputs, assert_ok=True ) + outputs = create[ 'outputs' ] + jobs = create[ 'jobs' ] + self.assertEquals( len( jobs ), 1 ) + self.assertEquals( len( outputs ), 1 ) + output1 = outputs[0] + output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output1 ) + assert output1_content.strip() == "123\n456", output1_content + @skip_without_tool( "multi_data_param" ) def test_reduce_multiple_lists_on_multi_data( self ): history_id = self.dataset_populator.new_history() diff --git a/test/functional/tools/multi_data_repeat.xml b/test/functional/tools/multi_data_repeat.xml new file mode 100644 index 00000000000..87cf2cf1913 --- /dev/null +++ b/test/functional/tools/multi_data_repeat.xml @@ -0,0 +1,13 @@ + + + cat #for o in $outer_repeat# #for $f in $o.f1# ${f} #end for# #end for# >> $out1; + + + + + + + + + + diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index eed98f05ece..e2f757b40ae 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -46,6 +46,7 @@ +