This would currently just fail with an exception in the logs.
I ran into this while manually defining a gxformat2 workflow
and not referencing the right step.
Since we cannot remove the user from the group to restore its previous state we need to use a user that will not be part of other tests to avoid unwanted interactions.
The second update does not provide a group_name as we are not changing it. This will fail with the current code as the update payload model is the same as the create one.
introduced in https://github.com/galaxyproject/galaxy/pull/18003 .
In particular, when using requests in the tests to connect to Galaxy
or the ToolShed it's not needed to use the modified headers.
Also:
- Move some imports after conditional imports.
- Fix type annotations in `lib/tool_shed/test/base/populators.py`
- Fix typo bug in `test/unit/util/test_get_url.py`
Provides a reasonable error message to users, instead of the internal
error https://sentry.galaxyproject.org/share/issue/a197159192b64b9db065a762ee5dbbfc/:
```
KeyError: 'Dataset collection has no element_identifier with key 2.'
File "galaxy/tools/__init__.py", line 1972, in handle_single_execution
rval = self.execute(
File "galaxy/tools/__init__.py", line 2069, in execute
return self.tool_action.execute(
File "galaxy/tools/actions/model_operations.py", line 88, in execute
self._produce_outputs(
File "galaxy/tools/actions/model_operations.py", line 119, in _produce_outputs
tool.produce_outputs(
File "galaxy/tools/__init__.py", line 3351, in produce_outputs
extracted_element = collection[incoming["which"]["identifier"]]
File "galaxy/model/__init__.py", line 6434, in __getitem__
raise KeyError(error_message)
```
Also makes the `identifier` parameter explicitly required (it is now
inferred to be optional because text parameters are by default optional
if no validator raises an exception upon validating an empty string).
That prevents
```
KeyError: 'Dataset collection has no element_identifier with key None.'
File "galaxy/tools/__init__.py", line 1972, in handle_single_execution
rval = self.execute(
File "galaxy/tools/__init__.py", line 2069, in execute
return self.tool_action.execute(
File "galaxy/tools/actions/model_operations.py", line 88, in execute
self._produce_outputs(
File "galaxy/tools/actions/model_operations.py", line 119, in _produce_outputs
tool.produce_outputs(
File "galaxy/tools/__init__.py", line 3351, in produce_outputs
extracted_element = collection[incoming["which"]["identifier"]]
File "galaxy/model/__init__.py", line 6434, in __getitem__
raise KeyError(error_message)
```
- Downstream I want a way to load plugins from outside the ConfiguredFileSources class.
- Adds some more typing as I went in there and refactored things.