Files
galaxy/test/functional/tools/output_action_change_format.xml
T
Matthias Bernt 85ec7832ba extend docs and tests for conditional output actions
for the case that a boolean is referred.

In this case the python string value of the parameter value
needs to be used as the value for the when tag which might be a
bit confusing.

The test is also extended such that:

- multiple (two) conditional actions are used in one output
- referring parameters in sections
2022-07-12 14:51:38 +02:00

68 lines
2.5 KiB
XML

<tool id="output_action_change_format" name="output_action_change_format" version="1.0.0">
<command>
printf "1\t2\n" > out1;
</command>
<inputs>
<conditional name="input_cond">
<param type="select" name="dispatch" label="Dispatch on type">
<option value="dont">Dont</option>
<option value="do">Do</option>
</param>
<when value="dont">
<param type="data" name="input" format="data" />
</when>
<when value="do">
<param type="data" name="input" format="data" />
</when>
</conditional>
<section name="asection" title="A Section">
<param type="boolean" name="abool" truevalue="does_not_matter_for_action" falsevalue="also_irrelevant"/>
</section>
</inputs>
<outputs>
<data name="out1" from_work_dir="out1">
<actions>
<conditional name="input_cond.dispatch">
<when value="do">
<action type="format">
<option type="from_param" name="input_cond.input" param_attribute="ext" />
</action>
</when>
</conditional>
<conditional name="asection.abool">
<when value="True">
<action name="dbkey" type="metadata" default="hg19"/>
</when>
<when value="False">
<action name="dbkey" type="metadata" default="hg38"/>
</when>
</conditional>
</actions>
</data>
</outputs>
<tests>
<test>
<param name="dispatch" value="dont" />
<param name="input" value="simple_line.txt" />
<param name="abool" value="true"/>
<output name="out1" ftype="data">
<assert_contents>
<has_line line="1&#009;2" />
</assert_contents>
<metadata name="dbkey" value="hg19" />
</output>
</test>
<test>
<param name="dispatch" value="do" />
<param name="input" value="simple_line.txt" />
<param name="abool" value="false"/>
<output name="out1" ftype="txt">
<assert_contents>
<has_line line="1&#009;2" />
</assert_contents>
<metadata name="dbkey" value="hg38" />
</output>
</test>
</tests>
</tool>