Skip to content

Commit

Permalink
Merge pull request #10669 from jmchilton/optional_inputs_api_test
Browse files Browse the repository at this point in the history
API workflow test showing structure of default/optionals parameters.
  • Loading branch information
nsoranzo authored Nov 10, 2020
2 parents 3337e24 + 08a4dda commit 41c649d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/galaxy_test/api/test_workflows_from_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

from galaxy_test.base.populators import uses_test_history
from galaxy_test.base.workflow_fixtures import (
WORKFLOW_PARAMETER_INPUT_INTEGER_DEFAULT,
WORKFLOW_RUNTIME_PARAMETER_SIMPLE,
WORKFLOW_SIMPLE_CAT_AND_RANDOM_LINES,
WORKFLOW_SIMPLE_CAT_TWICE,
WORKFLOW_WITH_OUTPUT_ACTIONS,
WORKFLOW_WITH_OUTPUTS
WORKFLOW_WITH_OUTPUTS,
)
from .test_workflows import BaseWorkflowsApiTestCase

Expand Down Expand Up @@ -320,6 +321,14 @@ def test_workflow_import_tool(self):
content = self.dataset_populator.get_history_dataset_content(history_id)
self.assertEqual(content, "hello world\nhello world 2\n")

def test_parameter_default_rep(self):
workflow = self._upload_and_download(WORKFLOW_PARAMETER_INPUT_INTEGER_DEFAULT)
int_input = self._steps_by_label(workflow)["int_input"]
int_input_state = json.loads(int_input["tool_state"])
assert int_input_state["default"] == 3
assert int_input_state["optional"] is True
assert int_input_state["parameter_type"] == "integer"

def _steps_by_label(self, workflow_as_dict):
by_label = {}
assert "steps" in workflow_as_dict, workflow_as_dict
Expand Down

0 comments on commit 41c649d

Please sign in to comment.