Skip to content

Commit

Permalink
Add API test to ensure that a proper error is returned if the dataset…
Browse files Browse the repository at this point in the history
… can't be opened
  • Loading branch information
mvdbeek committed May 23, 2024
1 parent 26b6c74 commit 0eced90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/galaxy_test/api/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,17 @@ def test_display(self, history_id):
self._assert_status_code_is(display_response, 200)
assert display_response.text == contents

def test_display_error_handling(self, history_id):
hda1 = self.dataset_populator.create_deferred_hda(
history_id, "https://raw.githubusercontent.com/galaxyproject/galaxy/dev/test-data/1.bed"
)
display_response = self._get(f"histories/{history_id}/contents/{hda1['id']}/display", {"raw": "True"})
self._assert_status_code_is(display_response, 409)
assert (
display_response.json()["err_msg"]
== "The dataset you are attempting to view has deferred data. You can only use this dataset as input for jobs."
)

def test_get_content_as_text(self, history_id):
contents = textwrap.dedent(
"""\
Expand Down

0 comments on commit 0eced90

Please sign in to comment.