From 53ee3dd8b22ec8c35480ac007bbe0664c6201ba8 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 1 Oct 2024 11:45:23 -0400 Subject: [PATCH] WIP: maybe dont want, more ps testing --- test/unit/app/tools/test_populate_state.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/unit/app/tools/test_populate_state.py b/test/unit/app/tools/test_populate_state.py index d641ff079397..2dad23f37f3f 100644 --- a/test/unit/app/tools/test_populate_state.py +++ b/test/unit/app/tools/test_populate_state.py @@ -4,6 +4,9 @@ Dict, ) +from galaxy.app_unittest_utils.galaxy_mock import MockTrans +from galaxy.app_unittest_utils.tools_support import UsesTools +from galaxy.tool_util.unittest_utils import functional_test_tool_path from galaxy.tools.parameters import ( populate_state, ToolInputsT, @@ -19,6 +22,7 @@ ) from galaxy.util import XML from galaxy.util.bunch import Bunch +from galaxy.util.unittest import TestCase trans = Bunch(workflow_building_mode=False) @@ -61,3 +65,18 @@ def test_populate_state(): assert state_new["b"][0]["c"] == 2 assert state_new["b"][0]["d"][0]["e"] == 3 assert state_new["b"][0]["d"][0]["f"]["h"] == 4 + + +class TestMetadata(TestCase, UsesTools): + def setUp(self): + super().setUp() + self.setup_app() + self.trans = MockTrans(app=self.app) + + def test_boolean_validation(self): + source_file_name = functional_test_tool_path("parameters/gx_data_column.xml") + tool = self._init_tool_for_path(source_file_name) + incoming = {"ref_parameter": {"src": "hda", "id": 89}, "parameter": "m89"} + state_new: Dict[str, Any] = {} + errors: Dict[str, Any] = {} + populate_state(self.trans, tool.inputs, incoming, state_new, errors=errors, check=True, input_format="21.01")