Unverified Commit dd171fe3 authored by mvdbeek's avatar mvdbeek
Browse files

Add test tool for default ext handling in discovered collections

parent d2956695
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
<tool id="discover_default_ext" name="discover_default_ext" version="0.1.0">
    <command><![CDATA[
echo 1 > 1.txt;
]]></command>
    <inputs />
    <outputs>
        <collection name="collection_with_default_ext" type="list" label="with default format" format="fasta">
            <discover_datasets pattern="__name_and_ext__" />
        </collection>
        <collection name="collection_default_ext_and_explicit_format" type="list" label="with default format and static element format" format="fasta">
            <discover_datasets pattern="__name__" format="txt" />
        </collection>
        <collection name="collection_default_ext_used" type="list" label="with default format and no override" format="fasta">
            <discover_datasets pattern="__name__" />
        </collection>
        <collection name="collection_without_default_ext" type="list" label="wihtout default ext, should be data">
            <discover_datasets pattern="__name__" />
        </collection>
    </outputs>
    <tests>
        <test expect_num_outputs="4">
            <output_collection name="collection_with_default_ext" type="list" count="1">
                <element name="1" ftype="txt">
                    <assert_contents>
                        <has_text text="1" />
                    </assert_contents>
                </element>
            </output_collection>
            <output_collection name="collection_default_ext_and_explicit_format" type="list" count="1">
                <element name="1.txt" ftype="txt">
                    <assert_contents>
                        <has_text text="1" />
                    </assert_contents>
                </element>
            </output_collection>
            <output_collection name="collection_default_ext_used" type="list" count="1">
                <element name="1.txt" ftype="fasta">
                    <assert_contents>
                        <has_text text="1" />
                    </assert_contents>
                </element>
            </output_collection>
            <output_collection name="collection_without_default_ext" type="list" count="1">
                <element name="1.txt" ftype="data">
                    <assert_contents>
                        <has_text text="1" />
                    </assert_contents>
                </element>
            </output_collection>
        </test>
    </tests>
</tool>
+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@
  <tool file="collection_cat_group_tag.xml" />
  <tool file="collection_cat_group_tag_multiple.xml" />
  <tool file="discover_sort_by.xml" />
  <tool file="discover_default_ext.xml" />
  <tool file="expression_forty_two.xml" />
  <tool file="expression_pick_larger_file.xml" />
  <tool file="expression_parse_int.xml" />