commit/galaxy-central: jmchilton: Workflow test utility build ds_map more easily.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/7601982d2180/ Changeset: 7601982d2180 User: jmchilton Date: 2014-07-25 21:47:34 Summary: Workflow test utility build ds_map more easily. Probably should do something like this server side so workflow API can be used more deterministically (wouldn't need to import a workflow and then hit the API to know how to use it). Affected #: 1 file diff -r f1123017cfcd1f1c2531b62624ceac4e28aa6dd4 -r 7601982d2180182671bb68349159947fc415800b test/api/test_workflows.py --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -412,28 +412,30 @@ def _setup_workflow_run( self, workflow, history_id=None ): uploaded_workflow_id = self.workflow_populator.create_workflow( workflow ) - workflow_inputs = self._workflow_inputs( uploaded_workflow_id ) - step_1 = step_2 = None - for key, value in workflow_inputs.iteritems(): - label = value[ "label" ] - if label == "WorkflowInput1": - step_1 = key - if label == "WorkflowInput2": - step_2 = key if not history_id: history_id = self.dataset_populator.new_history() hda1 = self.dataset_populator.new_dataset( history_id, content="1 2 3" ) hda2 = self.dataset_populator.new_dataset( history_id, content="4 5 6" ) + label_map = { + 'WorkflowInput1': self._ds_entry(hda1), + 'WorkflowInput2': self._ds_entry(hda2) + } workflow_request = dict( history="hist_id=%s" % history_id, workflow_id=uploaded_workflow_id, - ds_map=dumps( { - step_1: self._ds_entry(hda1), - step_2: self._ds_entry(hda2), - } ), + ds_map=self._build_ds_map( uploaded_workflow_id, label_map ), ) return workflow_request, history_id + def _build_ds_map( self, workflow_id, label_map ): + workflow_inputs = self._workflow_inputs( workflow_id ) + ds_map = {} + for key, value in workflow_inputs.iteritems(): + label = value[ "label" ] + if label in label_map: + ds_map[ key ] = label_map[ label ] + return dumps( ds_map ) + 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