From b1a8d0dd1674842fac94574a219baa8ddfef3b3d Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 16 Sep 2014 11:57:48 -0400 Subject: [PATCH] Add tools test for data_collection input parameter specification. --- test/api/test_tools.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/api/test_tools.py b/test/api/test_tools.py index 64800c9e45c..6f88ab598db 100644 --- a/test/api/test_tools.py +++ b/test/api/test_tools.py @@ -148,6 +148,20 @@ class ToolsTestCase( api.ApiTestCase ): response = self._run( "validation_default", history_id, inputs ) self._assert_status_code_is( response, 400 ) + @skip_without_tool( "collection_paired_test" ) + def test_collection_parameter( self ): + history_id = self.dataset_populator.new_history() + hdca_id = self.__build_pair( history_id, [ "123", "456" ] ) + inputs = { + "f1": { "src": "hdca", "id": hdca_id }, + } + output = self._run( "collection_paired_test", history_id, inputs, assert_ok=True ) + assert len( output[ 'jobs' ] ) == 1 + assert len( output[ 'implicit_collections' ] ) == 0 + assert len( output[ 'outputs' ] ) == 1 + contents = self.dataset_populator.get_history_dataset_content( history_id, hid=4 ) + assert contents.strip() == "123\n456", contents + @skip_without_tool( "cat1" ) def test_run_cat1_with_two_inputs( self ): # Run tool with an multiple data parameter and grouping (repeat)