From 2a23da50bd9d99de44e81463e273ba7a17fcf0e1 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 4 Dec 2014 12:28:23 -0500 Subject: [PATCH] Test case for passing null to optional tool input. --- test/api/test_tools.py | 14 ++++++++++++++ test/functional/tools/multi_select.xml | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/test/api/test_tools.py b/test/api/test_tools.py index cd0a8026fdd..6d02738796c 100644 --- a/test/api/test_tools.py +++ b/test/api/test_tools.py @@ -106,6 +106,20 @@ class ToolsTestCase( api.ApiTestCase ): output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output ) assert output1_content == "--ex1,ex2" + @skip_without_tool( "multi_select" ) + def test_multi_select_optional( self ): + history_id = self.dataset_populator.new_history() + inputs = { + "select_ex": ["--ex1"], + "select_optional": None, + } + response = self._run( "multi_select", history_id, inputs, assert_ok=True ) + output = response[ "outputs" ] + output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output[ 0 ] ) + output2_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output[ 1 ] ) + assert output1_content.strip() == "--ex1" + assert output2_content.strip() == "None", output2_content + @skip_without_tool( "multi_data_param" ) def test_multidata_param( self ): history_id = self.dataset_populator.new_history() diff --git a/test/functional/tools/multi_select.xml b/test/functional/tools/multi_select.xml index d1356157cae..5f940609e94 100644 --- a/test/functional/tools/multi_select.xml +++ b/test/functional/tools/multi_select.xml @@ -3,7 +3,7 @@ ${select_ex} - cat $config > $output + cat $config > $output; echo '$select_optional' > $output2 @@ -12,9 +12,17 @@ + + + + + + + +