mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix parse_values_from_file tool and tests
This commit is contained in:
@@ -2126,7 +2126,7 @@ steps:
|
||||
- label: consume_expression_parameter
|
||||
tool_id: validation_default
|
||||
in:
|
||||
input1: param_out#string_param
|
||||
input1: param_out#text_param
|
||||
outputs:
|
||||
out_file1:
|
||||
rename: "replaced_param_collection"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<description>from dataset</description>
|
||||
<expression type="ecma5.1">{
|
||||
var output;
|
||||
if ($job.remove_newlines || $job.param_type != 'string') {
|
||||
if ($job.remove_newlines || $job.param_type != 'text') {
|
||||
$job.input1.contents = $job.input1.contents.trim();
|
||||
}
|
||||
if ($job.param_type == 'integer') {
|
||||
@@ -29,7 +29,7 @@ return {'output': output};
|
||||
<inputs>
|
||||
<param type="data" label="Input file containing parameter to parse out of" load_contents="64000" name="input1" />
|
||||
<param name="param_type" type="select" label="Select type of parameter to parse">
|
||||
<option value="string">String</option>
|
||||
<option value="text">Text</option>
|
||||
<option value="integer">Integer</option>
|
||||
<option value="float">Float</option>
|
||||
<option value="boolean">Boolean</option>
|
||||
@@ -37,8 +37,8 @@ return {'output': output};
|
||||
<param name="remove_newlines" checked="true" type="boolean" label="Remove newlines ?" help="Uncheck this only if newlines should be preserved in parameter"/>
|
||||
</inputs>
|
||||
<outputs>
|
||||
<output type="string" name="string_param" from="output">
|
||||
<filter>param_type == 'string'</filter>
|
||||
<output type="text" name="text_param" from="output">
|
||||
<filter>param_type == 'text'</filter>
|
||||
</output>
|
||||
<output type="integer" name="integer_param" from="output">
|
||||
<filter>param_type == 'integer'</filter>
|
||||
@@ -53,9 +53,9 @@ return {'output': output};
|
||||
<tests>
|
||||
<test expect_num_outputs="1">
|
||||
<param name="input1" value="simple_line.txt"/>
|
||||
<param name="param_type" value="string"/>
|
||||
<param name="param_type" value="text"/>
|
||||
<param name="remove_newlines" value="true"/>
|
||||
<output name="string_param">
|
||||
<output name="text_param">
|
||||
<assert_contents>
|
||||
<has_line line=""This is a line of text.""/>
|
||||
</assert_contents>
|
||||
@@ -63,9 +63,9 @@ return {'output': output};
|
||||
</test>
|
||||
<test expect_num_outputs="1">
|
||||
<param name="input1" value="simple_line.txt"/>
|
||||
<param name="param_type" value="string"/>
|
||||
<param name="param_type" value="text"/>
|
||||
<param name="remove_newlines" value="false"/>
|
||||
<output name="string_param">
|
||||
<output name="text_param">
|
||||
<assert_contents>
|
||||
<has_line line=""This is a line of text.\n""/>
|
||||
</assert_contents>
|
||||
@@ -75,7 +75,7 @@ return {'output': output};
|
||||
<param name="input1" value="1.integer.txt"/>
|
||||
<param name="param_type" value="integer"/>
|
||||
<param name="remove_newlines" value="false"/>
|
||||
<output name="string_param">
|
||||
<output name="integer_param">
|
||||
<assert_contents>
|
||||
<has_line line="1"/>
|
||||
</assert_contents>
|
||||
@@ -85,7 +85,7 @@ return {'output': output};
|
||||
<param name="input1" value="1.integer.txt"/>
|
||||
<param name="param_type" value="float"/>
|
||||
<param name="remove_newlines" value="false"/>
|
||||
<output name="string_param">
|
||||
<output name="float_param">
|
||||
<assert_contents>
|
||||
<has_line line="1"/>
|
||||
</assert_contents>
|
||||
@@ -95,7 +95,7 @@ return {'output': output};
|
||||
<param name="input1" value="1.bool.txt"/>
|
||||
<param name="param_type" value="boolean"/>
|
||||
<param name="remove_newlines" value="false"/>
|
||||
<output name="string_param">
|
||||
<output name="boolean_param">
|
||||
<assert_contents>
|
||||
<has_line line="false"/>
|
||||
</assert_contents>
|
||||
|
||||
Reference in New Issue
Block a user