mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix PUT request in API workflow tests
Fix the errors like the following with FastAPI 0.132.0:
```
FAILED lib/galaxy_test/api/test_workflows.py::TestWorkflowsApi::test_run_runtime_parameters_after_pause - AssertionError: Request status code (400) was not expected value 200. Body was {'err_msg': "Input should be a valid dictionary or object to extract fields from in ('body',)", 'err_code': 400008, 'validation_errors': ['{"type": "model_attributes_type", "loc": ["body"], "msg": "Input should be a valid dictionary or object to extract fields from", "input": [123, 34, 97, 99, 116, 105, 111, 110, 34, 58, 32, 116, 114, 117, 101, 125]}']}
```
This commit is contained in:
@@ -21,7 +21,6 @@ from requests import (
|
||||
delete,
|
||||
get,
|
||||
post,
|
||||
put,
|
||||
)
|
||||
|
||||
from galaxy.exceptions import error_codes
|
||||
@@ -9309,11 +9308,11 @@ outer_input:
|
||||
invocation_step_details = invocation_step_response.json()
|
||||
return invocation_step_details
|
||||
|
||||
def _execute_invocation_step_action(self, workflow_id, invocation_id, step_id, action):
|
||||
def _execute_invocation_step_action(self, workflow_id: str, invocation_id: str, step_id: str, action: bool):
|
||||
raw_url = f"workflows/{workflow_id}/usage/{invocation_id}/steps/{step_id}"
|
||||
url = self._api_url(raw_url, use_key=True)
|
||||
payload = dumps(dict(action=action))
|
||||
action_response = put(url, data=payload)
|
||||
payload = {"action": action}
|
||||
action_response = self._put(url, data=payload, json=True)
|
||||
self._assert_status_code_is(action_response, 200)
|
||||
invocation_step_details = action_response.json()
|
||||
return invocation_step_details
|
||||
@@ -9349,7 +9348,9 @@ outer_input:
|
||||
)
|
||||
return workflow_request, history_id, uploaded_workflow_id
|
||||
|
||||
def __review_paused_steps(self, uploaded_workflow_id, invocation_id, order_index, action=True):
|
||||
def __review_paused_steps(
|
||||
self, uploaded_workflow_id: str, invocation_id: str, order_index: int, action: bool = True
|
||||
) -> None:
|
||||
invocation = self._invocation_details(uploaded_workflow_id, invocation_id)
|
||||
invocation_steps = invocation["steps"]
|
||||
pause_steps = [s for s in invocation_steps if s["order_index"] == order_index]
|
||||
|
||||
Reference in New Issue
Block a user