From 05629e61fe6e5e42d12b0c7ae63a8dcd7b6a55f0 Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Thu, 25 Jan 2024 10:56:53 +0100 Subject: [PATCH] Add json keyword when posting to /api/tools during testing --- lib/galaxy/tool_util/verify/interactor.py | 2 +- lib/galaxy_test/api/test_dataset_collections.py | 2 +- lib/galaxy_test/api/test_jobs.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py index 94cdb25a8efd..1df91de184eb 100644 --- a/lib/galaxy/tool_util/verify/interactor.py +++ b/lib/galaxy/tool_util/verify/interactor.py @@ -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 diff --git a/lib/galaxy_test/api/test_dataset_collections.py b/lib/galaxy_test/api/test_dataset_collections.py index c7601e2242a2..ebe08f04b361 100644 --- a/lib/galaxy_test/api/test_dataset_collections.py +++ b/lib/galaxy_test/api/test_dataset_collections.py @@ -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 diff --git a/lib/galaxy_test/api/test_jobs.py b/lib/galaxy_test/api/test_jobs.py index 298c8952ce1e..12ce9c472779 100644 --- a/lib/galaxy_test/api/test_jobs.py +++ b/lib/galaxy_test/api/test_jobs.py @@ -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}") @@ -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) @@ -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