Test case for mapping over inputs with output ftype determined via input extension

This commit is contained in:
mvdbeek
2018-06-04 07:00:41 -04:00
committed by John Chilton
parent bc8254faec
commit 3e22b0b11b
3 changed files with 50 additions and 0 deletions
+17
View File
@@ -736,6 +736,23 @@ class ToolsTestCase(api.ApiTestCase):
assert output1_details["file_ext"] == "txt" if (use_action == "do") else "data"
assert output2_details["file_ext"] == "txt" if (use_action == "do") else "data"
@skip_without_tool("output_action_change_format_paired")
def test_map_over_with_nested_paired_output_format_actions(self):
history_id = self.dataset_populator.new_history()
hdca_id = self.__build_nested_list(history_id)
inputs = {
"input": {'batch': True, 'values': [dict(map_over_type='paired', src="hdca", id=hdca_id)]}
}
create = self._run('output_action_change_format_paired', history_id, inputs).json()
outputs = create['outputs']
jobs = create['jobs']
implicit_collections = create['implicit_collections']
self.assertEquals(len(jobs), 2)
self.assertEquals(len(outputs), 2)
self.assertEquals(len(implicit_collections), 1)
for output in outputs:
assert output["file_ext"] == "txt"
@skip_without_tool("output_filter_with_input")
def test_map_over_with_output_filter_no_filtering(self):
with self.dataset_populator.test_history() as history_id:
@@ -0,0 +1,32 @@
<tool id="output_action_change_format_paired" name="output_action_change_paired" version="1.0.0">
<command>
printf "1\t2\n" > out1;
</command>
<inputs>
<param type="data_collection" name="input" format="data" collection_type="paired" />
</inputs>
<outputs>
<data name="out1" from_work_dir="out1">
<actions>
<action type="format">
<option type="from_param" name="input" param_attribute="forward.ext" />
</action>
</actions>
</data>
</outputs>
<tests>
<test>
<param name="input">
<collection type="paired">
<element name="forward" value="simple_line.txt" ftype="txt" />
<element name="reverse" value="simple_line.txt" ftype="txt" />
</collection>
</param>
<output name="out1" ftype="txt">
<assert_contents>
<has_line line="1&#009;2" />
</assert_contents>
</output>
</test>
</tests>
</tool>
@@ -106,6 +106,7 @@
<tool file="fail_writing_work_dir_file.xml" />
<tool file="tool_directory.xml" />
<tool file="output_action_change_format.xml" />
<tool file="output_action_change_format_paired.xml" />
<tool file="collection_paired_test.xml" />
<tool file="collection_paired_structured_like.xml" />
<tool file="collection_paired_conditional_structured_like.xml" />