commit/galaxy-central: jmchilton: Tool test for broken behavior where nested parameter replacements are passed in for a workflow step.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/7fc0bcc3cdb1/ Changeset: 7fc0bcc3cdb1 User: jmchilton Date: 2014-11-14 18:01:10+00:00 Summary: Tool test for broken behavior where nested parameter replacements are passed in for a workflow step. Affected #: 1 file diff -r 596d33e8af919c113028cb943ea2251f9b2bd157 -r 7fc0bcc3cdb1e17485035e420d1e0452173cab61 test/api/test_workflows.py --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -650,12 +650,8 @@ @skip_without_tool( "random_lines1" ) def test_run_replace_params_by_steps( self ): - workflow_request, history_id = self._setup_random_x2_workflow( "test_for_replace_step_params" ) - workflow_summary_response = self._get( "workflows/%s" % workflow_request[ "workflow_id" ] ) - self._assert_status_code_is( workflow_summary_response, 200 ) - steps = workflow_summary_response.json()[ "steps" ] - last_step_id = str( max( map( int, steps.keys() ) ) ) - params = dumps( { last_step_id: dict( num_lines=5 ) } ) + workflow_request, history_id, steps = self._setup_random_x2_workflow_steps( "test_for_replace_step_params" ) + params = dumps( { str(steps[1]["id"]): dict( num_lines=5 ) } ) workflow_request[ "parameters" ] = params run_workflow_response = self._post( "workflows", data=workflow_request ) self._assert_status_code_is( run_workflow_response, 200 ) @@ -664,6 +660,21 @@ self.__assert_lines_hid_line_count_is( history_id, 2, 8 ) self.__assert_lines_hid_line_count_is( history_id, 3, 5 ) + @skip_without_tool( "random_lines1" ) + def test_run_replace_params_nested( self ): + workflow_request, history_id, steps = self._setup_random_x2_workflow_steps( "test_for_replace_step_params_nested" ) + seed_source = dict( + seed_source_selector="set_seed", + seed="moo", + ) + params = dumps( { str(steps[0]["id"]): dict( num_lines=1, seed_source=seed_source ), + str(steps[1]["id"]): dict( num_lines=1, seed_source=seed_source ) } ) + workflow_request[ "parameters" ] = params + run_workflow_response = self._post( "workflows", data=workflow_request ) + self._assert_status_code_is( run_workflow_response, 200 ) + self.dataset_populator.wait_for_history( history_id, assert_ok=True ) + self.assertEquals("3\n", self.dataset_populator.get_history_dataset_content( history_id ) ) + def test_pja_import_export( self ): workflow = self.workflow_populator.load_workflow( name="test_for_pja_import", add_pja=True ) uploaded_workflow_id = self.workflow_populator.create_workflow( workflow ) @@ -774,6 +785,17 @@ ds_map[ key ] = label_map[ label ] return dumps( ds_map ) + def _setup_random_x2_workflow_steps( self, name ): + workflow_request, history_id = self._setup_random_x2_workflow( "test_for_replace_step_params" ) + random_line_steps = self._random_lines_steps( workflow_request ) + return workflow_request, history_id, random_line_steps + + def _random_lines_steps( self, workflow_request ): + workflow_summary_response = self._get( "workflows/%s" % workflow_request[ "workflow_id" ] ) + self._assert_status_code_is( workflow_summary_response, 200 ) + steps = workflow_summary_response.json()[ "steps" ] + return sorted( filter(lambda step: step["tool_id"] == "random_lines1", steps.values()), key=lambda step: step["id"] ) + def _setup_random_x2_workflow( self, name ): workflow = self.workflow_populator.load_random_x2_workflow( name ) uploaded_workflow_id = self.workflow_populator.create_workflow( workflow ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org