Skip to content

Commit

Permalink
Test that switching parameters results in filtered outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Mar 5, 2019
1 parent 35caf35 commit 5c521e1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,50 @@ def test_export_editor(self):
'label',
)

@skip_without_tool('output_filter')
def test_export_editor_filtered_outputs(self):
template = """
class: GalaxyWorkflow
steps:
- tool_id: output_filter_with_input
state:
produce_out_1: {produce_out_1}
filter_text_1: {filter_text_1}
produce_collection: false
produce_paired_collection: false
"""
workflow_id = self._upload_yaml_workflow(template.format(produce_out_1='false', filter_text_1='false'))
downloaded_workflow = self._download_workflow(workflow_id, style="editor")
outputs = downloaded_workflow['steps']['0']['outputs']
assert len(outputs) == 1
assert outputs[0]['name'] == 'out_3'
workflow_id = self._upload_yaml_workflow(template.format(produce_out_1='true', filter_text_1='false'))
downloaded_workflow = self._download_workflow(workflow_id, style="editor")
outputs = downloaded_workflow['steps']['0']['outputs']
assert len(outputs) == 2
assert outputs[0]['name'] == 'out_1'
assert outputs[1]['name'] == 'out_3'
workflow_id = self._upload_yaml_workflow(template.format(produce_out_1='true', filter_text_1='foo'))
downloaded_workflow = self._download_workflow(workflow_id, style="editor")
outputs = downloaded_workflow['steps']['0']['outputs']
assert len(outputs) == 3
assert outputs[0]['name'] == 'out_1'
assert outputs[1]['name'] == 'out_2'
assert outputs[2]['name'] == 'out_3'

@skip_without_tool('output_filter_with_input')
def test_export_editor_filtered_outputs_exception_handling(self):
workflow_id = self._upload_yaml_workflow("""
class: GalaxyWorkflow
steps:
- tool_id: output_filter_exception_1
""")
downloaded_workflow = self._download_workflow(workflow_id, style="editor")
outputs = downloaded_workflow['steps']['0']['outputs']
assert len(outputs) == 2
assert outputs[0]['name'] == 'out_1'
assert outputs[1]['name'] == 'out_2'

@skip_without_tool('collection_type_source')
def test_export_editor_collection_type_source(self):
workflow_id = self._upload_yaml_workflow("""
Expand Down
2 changes: 2 additions & 0 deletions test/functional/tools/output_filter_with_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<filter>filter_text_1 == "foo"</filter>
</data>
<data format="txt" from_work_dir="3" name="out_3">
<!-- always produce out_3 -->
<filter>input_1.ext != 'xyz'</filter>
</data>
</outputs>
<tests>
Expand Down

0 comments on commit 5c521e1

Please sign in to comment.