mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
80 lines
3.4 KiB
XML
80 lines
3.4 KiB
XML
<tool id="gx_conditional_boolean_optional" name="gx_conditional_boolean_optional" version="1.0.0">
|
|
<macros>
|
|
<import>macros.xml</import>
|
|
</macros>
|
|
<expand macro="common_conditional_tags" />
|
|
<inputs>
|
|
<conditional name="conditional_parameter">
|
|
<!-- boolean parameters as the test parameter are discouraged, respect linting and don't do this -->
|
|
<param name="test_parameter" type="boolean" optional="true" />
|
|
<when value="true">
|
|
<param name="integer_parameter" type="integer" value="1" />
|
|
</when>
|
|
<when value="false">
|
|
<param name="boolean_parameter" type="boolean" />
|
|
</when>
|
|
</conditional>
|
|
</inputs>
|
|
<tests>
|
|
<test>
|
|
<expand macro="assert_output">
|
|
<has_line line="test: false" />
|
|
</expand>
|
|
<expand macro="assert_inputs_json">
|
|
<has_json_property_with_value property="test_parameter" value="false" />
|
|
</expand>
|
|
</test>
|
|
<test>
|
|
<conditional name="conditional_parameter">
|
|
<param name="test_parameter" value_json="null" />
|
|
</conditional>
|
|
<expand macro="assert_output">
|
|
<has_line line="test: false" />
|
|
</expand>
|
|
<expand macro="assert_inputs_json">
|
|
<!-- When it is a conditional test parameter - it doesn't respect the null. -->
|
|
<!-- These are discouraged strongly discouraged already - maybe disable for newer profile version. -->
|
|
<has_json_property_with_value property="test_parameter" value="false" />
|
|
<!-- The disrespected null was interpreted as false though -->
|
|
<has_json_property_with_value property="boolean_parameter" value="false" />
|
|
</expand>
|
|
</test>
|
|
<test>
|
|
<conditional name="conditional_parameter">
|
|
<param name="test_parameter" value="true" />
|
|
</conditional>
|
|
<expand macro="assert_output">
|
|
<has_line line="test: true" />
|
|
</expand>
|
|
<expand macro="assert_inputs_json">
|
|
<has_json_property_with_value property="test_parameter" value="true" />
|
|
<has_json_property_with_value property="integer_parameter" value="1" />
|
|
</expand>
|
|
</test>
|
|
<test>
|
|
<conditional name="conditional_parameter">
|
|
<param name="test_parameter" value_json="false" />
|
|
</conditional>
|
|
<expand macro="assert_output">
|
|
<has_line line="test: false" />
|
|
</expand>
|
|
<expand macro="assert_inputs_json">
|
|
<has_json_property_with_value property="test_parameter" value="false" />
|
|
<has_json_property_with_value property="boolean_parameter" value="false" />
|
|
</expand>
|
|
</test>
|
|
<test>
|
|
<conditional name="conditional_parameter">
|
|
<param name="test_parameter" value_json="true" />
|
|
</conditional>
|
|
<expand macro="assert_output">
|
|
<has_line line="test: true" />
|
|
</expand>
|
|
<expand macro="assert_inputs_json">
|
|
<has_json_property_with_value property="test_parameter" value="true" />
|
|
<has_json_property_with_value property="integer_parameter" value="1" />
|
|
</expand>
|
|
</test>
|
|
</tests>
|
|
</tool>
|