Skip to content

Commit

Permalink
Add json=true to library_content api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Sep 26, 2024
1 parent f3e3f6d commit eb36c65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/galaxy_test/api/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def test_legacy_upload_unknown_datatype(self):
"upload_option": "upload_file",
"files_0|url_paste": FILE_URL,
}
create_response = self._post(f"libraries/{library['id']}/contents", payload)
create_response = self._post(f"libraries/{library['id']}/contents", payload, json=True)
self._assert_status_code_is(create_response, 400)
assert create_response.json() == "Requested extension 'xxx' unknown, cannot upload dataset."

Expand Down Expand Up @@ -552,7 +552,7 @@ def test_create_datasets_in_library_from_collection(self):
history_id, contents=["xxx", "yyy"], direct_upload=True, wait=True
).json()["outputs"][0]["id"]
payload = {"from_hdca_id": hdca_id, "create_type": "file", "folder_id": folder_id}
create_response = self._post(f"libraries/{library['id']}/contents", payload)
create_response = self._post(f"libraries/{library['id']}/contents", payload, json=True)
self._assert_status_code_is(create_response, 200)

@requires_new_library
Expand Down Expand Up @@ -588,7 +588,7 @@ def _create_folder(self, library):
create_type="folder",
name="New Folder",
)
return self._post(f"libraries/{library['id']}/contents", data=create_data)
return self._post(f"libraries/{library['id']}/contents", data=create_data, json=True)

def _create_subfolder(self, containing_folder_id):
create_data = dict(
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy_test/base/populators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2740,7 +2740,7 @@ def raw_library_contents_create(self, library_id, payload, files=None):
files = {}

url_rel = f"libraries/{library_id}/contents"
return self.galaxy_interactor.post(url_rel, payload, files=files)
return self.galaxy_interactor.post(url_rel, payload, files=files, json=True)

def show_ld_raw(self, library_id: str, library_dataset_id: str) -> Response:
response = self.galaxy_interactor.get(f"libraries/{library_id}/contents/{library_dataset_id}")
Expand All @@ -2759,7 +2759,7 @@ def show_ldda(self, ldda_id):
def new_library_dataset_in_private_library(self, library_name="private_dataset", wait=True):
library = self.new_private_library(library_name)
payload, files = self.create_dataset_request(library, file_type="txt", contents="create_test")
create_response = self.galaxy_interactor.post(f"libraries/{library['id']}/contents", payload, files=files)
create_response = self.galaxy_interactor.post(f"libraries/{library['id']}/contents", payload, files=files, json=True)
api_asserts.assert_status_code_is(create_response, 200)
library_datasets = create_response.json()
assert len(library_datasets) == 1
Expand Down

0 comments on commit eb36c65

Please sign in to comment.