Skip to content

Commit

Permalink
fix test and improve for legacy mapping
Browse files Browse the repository at this point in the history
the test for the nesting case accidentally works since the
[legacy_mapping](https://github.com/galaxyproject/galaxy/blob/16ec912385b59429b1e87cebb817ec012b02ec4e/lib/galaxy/tools/parameters/wrapped.py#L43) contains a wrong mapping.
with the output2 we can now test this.

with output3 we now also test that the legacy behavior works.
  • Loading branch information
bernt-matthias committed Dec 18, 2024
1 parent fd778c4 commit 5a06678
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/functional/tools/format_source_in_conditional.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<tool id="format_source_in_conditional" name="format source in conditional" version="0.1.0">
<command>cp '$input1' '$output1'</command>
<command><![CDATA[
cp '$input1' '$output1' &&
cp '$input1' '$output2' &&
cp '$input1' '$output3'
]]></command>
<inputs>
<conditional name="cond">
<param name="select" type="select">
Expand All @@ -15,14 +19,16 @@
<option value="value">the only option</option>
</param>
<when value="value">
<param name="input1" type="data" format="txt"/>
<param name="input1" type="data" format="tsv"/>
</when>
</conditional>
</when>
</conditional>
</inputs>
<outputs>
<data name="output1" format_source="cond|input1"/>
<data name="output1" format_source="cond|input1"/><!-- format_source should only work for "no_extra_nesting" -->
<data name="output2" format_source="cond|inner_cond|input1"/><!-- format_source should only work for "extra_nesting" -->
<data name="output3" format_source="input1"/><!-- format_source with legacy behavior -->
</outputs>
<tests>
<test>
Expand All @@ -31,15 +37,19 @@
<param name="input1" value="1.tabular" ftype="tabular"/>
</conditional>
<output name="output1" value="1.tabular" ftype="tabular" lines_diff="2"/>
<output name="output2" value="1.tabular" ftype="data" lines_diff="2"/>
<output name="output3" value="1.tabular" ftype="tabular" lines_diff="2"/>
</test>
<test>
<conditional name="cond">
<param name="select" value="extra_nesting"/>
<conditional name="inner_cond">
<param name="input1" value="1.txt" ftype="txt"/>
<param name="input1" value="1.tabular" ftype="tsv"/>
</conditional>
</conditional>
<output name="output1" value="1.txt" ftype="txt"/>
<output name="output1" value="1.tabular" ftype="data" lines_diff="2"/>
<output name="output2" value="1.tabular" ftype="tsv" lines_diff="2"/>
<output name="output3" value="1.tabular" ftype="tsv" lines_diff="2"/>
</test>
</tests>
</tool>

0 comments on commit 5a06678

Please sign in to comment.