|
26 | 26 | ) |
27 | 27 |
|
28 | 28 | from galaxy.exceptions import error_codes |
| 29 | +from galaxy.tool_util_models import UserToolSource |
29 | 30 | from galaxy.util import UNKNOWN |
30 | 31 | from galaxy.util.unittest_utils import skip_if_github_down |
| 32 | +from galaxy_test.api.test_tools import TOOL_WITH_SHELL_COMMAND |
31 | 33 | from galaxy_test.base import rules_test_data |
32 | 34 | from galaxy_test.base.populators import ( |
33 | 35 | DatasetCollectionPopulator, |
@@ -8085,6 +8087,33 @@ def test_cannot_run_workflow_on_immutable_history(self) -> None: |
8085 | 8087 | history_id=history_id, |
8086 | 8088 | ) |
8087 | 8089 |
|
| 8090 | + def test_user_defined_workflow_update(self): |
| 8091 | + with self.dataset_populator.user_tool_execute_permissions(): |
| 8092 | + unprivileged_tool = self.dataset_populator.create_unprivileged_tool( |
| 8093 | + UserToolSource(**TOOL_WITH_SHELL_COMMAND) |
| 8094 | + ) |
| 8095 | + # Workflow doesn't matter, we're replacing it in the update |
| 8096 | + workflow = self.workflow_populator.load_workflow_from_resource("test_workflow_pause") |
| 8097 | + workflow_id = self.workflow_populator.create_workflow(workflow) |
| 8098 | + update_response = self._update_workflow( |
| 8099 | + workflow_id, |
| 8100 | + { |
| 8101 | + "steps": { |
| 8102 | + "0": { |
| 8103 | + "content_id": "cat_user_defined", |
| 8104 | + "id": 1, |
| 8105 | + "input_connections": {"datasets": []}, |
| 8106 | + "name": "Concatenate Files", |
| 8107 | + "tool_uuid": unprivileged_tool["uuid"], |
| 8108 | + "type": "tool", |
| 8109 | + } |
| 8110 | + }, |
| 8111 | + }, |
| 8112 | + ) |
| 8113 | + assert update_response.status_code == 200, update_response.text |
| 8114 | + workflow = self.workflow_populator.download_workflow(workflow_id) |
| 8115 | + assert workflow["steps"]["0"]["tool_representation"]["class"] == "GalaxyUserTool" |
| 8116 | + |
8088 | 8117 | def _invoke_paused_workflow(self, history_id): |
8089 | 8118 | workflow = self.workflow_populator.load_workflow_from_resource("test_workflow_pause") |
8090 | 8119 | workflow_id = self.workflow_populator.create_workflow(workflow) |
|
0 commit comments