Skip to content

Commit

Permalink
Add json keyword when posting to /api/tools during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
heisner-tillman committed Jan 25, 2024
1 parent 5d15099 commit f0c50aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/verify/interactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def __submit_tool(self, history_id, tool_id, tool_input, extra_data=None, files=
data = dict(
history_id=history_id, tool_id=tool_id, inputs=dumps(tool_input), tool_version=tool_version, **extra_data
)
return self._post("tools", files=files, data=data)
return self._post("tools", files=files, data=data, json=True)

def ensure_user_with_email(self, email, password=None):
admin_key = self.master_api_key
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy_test/api/test_dataset_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def test_collection_tools_tag_propagation(self, history_id):
history_id=history_id,
input_format="legacy",
)
response = self._post("tools", payload).json()
response = self._post("tools", payload, json=True).json()
self.dataset_populator.wait_for_history(history_id, assert_ok=False)
output_collection = response["output_collections"][0]
# collection should not inherit tags from input collection elements, only parent collection
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy_test/api/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ def test_delete_job(self, history_id):
inputs = json.dumps({"input1": {"src": "hda", "id": dataset_id}})
search_payload = self._search_payload(history_id=history_id, tool_id="cat1", inputs=inputs)
# create a job
tool_response = self._post("tools", data=search_payload)
tool_response = self._post("tools", data=search_payload, json=True)
job_id = tool_response.json()["jobs"][0]["id"]
# delete the job without message
delete_job_response = self._delete(f"jobs/{job_id}")
Expand Down Expand Up @@ -1034,7 +1034,7 @@ def test_parameters_display(self, history_id):
def _create_and_search_job(self, history_id, inputs, tool_id):
# create a job
search_payload = self._search_payload(history_id=history_id, tool_id=tool_id, inputs=inputs)
tool_response = self._post("tools", data=search_payload)
tool_response = self._post("tools", data=search_payload, json=True)
self.dataset_populator.wait_for_tool_run(history_id, run_response=tool_response)
# search for the job and get the corresponding values
search_response = self._post("jobs/search", data=search_payload, json=True)
Expand All @@ -1046,7 +1046,7 @@ def _job_search(self, tool_id, history_id, inputs):
empty_search_response = self._post("jobs/search", data=search_payload, json=True)
self._assert_status_code_is(empty_search_response, 200)
assert len(empty_search_response.json()) == 0
tool_response = self._post("tools", data=search_payload)
tool_response = self._post("tools", data=search_payload, json=True)
self.dataset_populator.wait_for_tool_run(history_id, run_response=tool_response)
self._search(search_payload, expected_search_count=1)
return tool_response
Expand Down

0 comments on commit f0c50aa

Please sign in to comment.