Skip to content

Commit

Permalink
Merge pull request galaxyproject#16747 from nsoranzo/test_dataset_col…
Browse files Browse the repository at this point in the history
…lection_hide_originals_copy_elements

Don't copy collection elements in ``test_dataset_collection_hide_originals``
  • Loading branch information
nsoranzo authored Sep 27, 2023
2 parents ab0354b + d26186f commit 0781880
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/webapps/galaxy/services/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,9 +1269,9 @@ def __create_dataset_collection(
raise exceptions.RequestParameterMissingException("'content' id of target to copy is missing")
dbkey = payload.dbkey
copy_required = dbkey is not None
copy_elements = payload.copy_elements or copy_required
copy_elements = payload.copy_elements
if copy_required and not copy_elements:
raise exceptions.RequestParameterMissingException(
raise exceptions.RequestParameterInvalidException(
"copy_elements passed as 'false' but it is required to change specified attributes"
)
dataset_instance_attributes = {}
Expand Down
6 changes: 2 additions & 4 deletions lib/galaxy_test/api/test_history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,17 +495,15 @@ def test_jobs_summary_implicit_hdca(self, history_id):

def test_dataset_collection_hide_originals(self, history_id):
payload = self.dataset_collection_populator.create_pair_payload(
history_id, type="dataset_collection", direct_upload=False
history_id, type="dataset_collection", direct_upload=False, copy_elements=False
)

payload["hide_source_items"] = True
dataset_collection_response = self._post(f"histories/{history_id}/contents", payload, json=True)
self.__check_create_collection_response(dataset_collection_response)

contents_response = self._get(f"histories/{history_id}/contents")
datasets = [
d for d in contents_response.json() if d["history_content_type"] == "dataset" and d["hid"] in [1, 2]
]
datasets = [d for d in contents_response.json() if d["history_content_type"] == "dataset"]
# Assert two datasets in source were hidden.
assert len(datasets) == 2
assert not datasets[0]["visible"]
Expand Down

0 comments on commit 0781880

Please sign in to comment.