diff --git a/lib/galaxy_test/api/test_tools.py b/lib/galaxy_test/api/test_tools.py index a8f0cb1ebc34..287b5ca20c4f 100644 --- a/lib/galaxy_test/api/test_tools.py +++ b/lib/galaxy_test/api/test_tools.py @@ -1002,6 +1002,41 @@ def test_optional_repeats_with_mins_filled_id(self): assert "false" in output1_content assert "length: 2" in output1_content + def test_data_column_defaults(self): + with self.dataset_populator.test_history(require_new=False) as history_id: + hda = dataset_to_param(self.dataset_populator.new_dataset(history_id, content="1\t2\t3\t4", file_type="tabular")) + inputs = {"ref_parameter": hda} + response = self._run("gx_data_column", history_id, inputs, assert_ok=False).json() + output = response["outputs"] + details = self.dataset_populator.get_history_dataset_details(history_id, dataset=output[0], assert_ok=False) + assert details["state"] == "error" + + with self.dataset_populator.test_history(require_new=True) as history_id: + response = self._run("gx_data_column_optional", history_id, inputs, assert_ok=True) + output = response["outputs"] + content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output[0]) + assert "parameter: None" in content + + response = self._run("gx_data_column_with_default", history_id, inputs, assert_ok=True) + output = response["outputs"] + content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output[0]) + assert "parameter: 2" in content + + response = self._run("gx_data_column_with_default_legacy", history_id, inputs, assert_ok=True) + output = response["outputs"] + content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output[0]) + assert "parameter: 3" in content + + response = self._run("gx_data_column_accept_default", history_id, inputs, assert_ok=True) + output = response["outputs"] + content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output[0]) + assert "parameter: 1" in content + + response = self._run("gx_data_column_multiple_with_default", history_id, inputs, assert_ok=True) + output = response["outputs"] + content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output[0]) + assert "parameter: 1,2" in content + @skip_without_tool("library_data") def test_library_data_param(self): with self.dataset_populator.test_history(require_new=False) as history_id: diff --git a/test/functional/tools/parameters/gx_data_column_accept_default.xml b/test/functional/tools/parameters/gx_data_column_accept_default.xml new file mode 100644 index 000000000000..80a0f3d5f77a --- /dev/null +++ b/test/functional/tools/parameters/gx_data_column_accept_default.xml @@ -0,0 +1,21 @@ + + + macros.xml + + > '$output' + ]]> + + + + + + + + + + + + + + diff --git a/test/functional/tools/parameters/data_column_multiple_optional.xml b/test/functional/tools/parameters/gx_data_column_multiple_optional.xml similarity index 100% rename from test/functional/tools/parameters/data_column_multiple_optional.xml rename to test/functional/tools/parameters/gx_data_column_multiple_optional.xml diff --git a/test/functional/tools/parameters/gx_data_column_multiple_with_default.xml b/test/functional/tools/parameters/gx_data_column_multiple_with_default.xml new file mode 100644 index 000000000000..fca81373d544 --- /dev/null +++ b/test/functional/tools/parameters/gx_data_column_multiple_with_default.xml @@ -0,0 +1,21 @@ + + + macros.xml + + > '$output' + ]]> + + + + + + + + + + + + + + diff --git a/test/functional/tools/parameters/gx_data_column_with_default.xml b/test/functional/tools/parameters/gx_data_column_with_default.xml new file mode 100644 index 000000000000..126c4dfc8ec1 --- /dev/null +++ b/test/functional/tools/parameters/gx_data_column_with_default.xml @@ -0,0 +1,22 @@ + + + macros.xml + + > '$output' + ]]> + + + + + + + + + + + + + + + diff --git a/test/functional/tools/parameters/gx_data_column_with_default_legacy.xml b/test/functional/tools/parameters/gx_data_column_with_default_legacy.xml new file mode 100644 index 000000000000..b77b546add50 --- /dev/null +++ b/test/functional/tools/parameters/gx_data_column_with_default_legacy.xml @@ -0,0 +1,22 @@ + + + macros.xml + + > '$output' + ]]> + + + + + + + + + + + + + + +