Skip to content

Commit

Permalink
Add test for default value with optional input
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Nov 29, 2024
1 parent 5d4e341 commit 59dc2a4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
34 changes: 34 additions & 0 deletions lib/galaxy_test/workflow/default_values_optional.gxwf-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- doc: |
Test that default value doesn't need to be supplied
job: {}
outputs:
out:
class: File
asserts:
- that: has_text
text: "1"
- doc: |
Test that null is replaced with default value (follows https://www.commonwl.org/v1.2/Workflow.html#WorkflowInputParameter)
job:
optional_int_with_default:
type: raw
value: null
outputs:
out:
class: File
asserts:
- that: has_text
text: "1"
- doc: |
Test that empty string is not replaced and fails
expect_failure: true
job:
optional_int_with_default:
type: raw
value: ""
outputs:
out:
class: File
asserts:
- that: has_text
text: "1"
18 changes: 18 additions & 0 deletions lib/galaxy_test/workflow/default_values_optional.gxwf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class: GalaxyWorkflow
inputs:
optional_int_with_default:
type: int
default: 1
optional: true
outputs:
out:
outputSource: integer_default/out_file1
steps:
integer_default:
tool_id: integer_default
tool_state:
input1: 0
input2: 0
in:
input3:
source: optional_int_with_default

0 comments on commit 59dc2a4

Please sign in to comment.