Skip to content

Commit

Permalink
Test that hash is required to match equivalent inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Nov 6, 2024
1 parent 9dc3839 commit b3ab7ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/galaxy_test/api/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2436,12 +2436,15 @@ def test_group_tag_selection_multiple(self, history_id):
output_content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output)
assert output_content.strip() == "123\n456\n456\n0ab"

def _run_deferred(self, history_id: str, use_cached_job=False, expect_cached_job=False):
def _run_deferred(self, history_id: str, use_cached_job=False, expect_cached_job=False, include_correct_hash=True):
hashes: Optional[List[Dict[str, str]]] = None
if include_correct_hash:
hashes = [{"hash_function": "SHA-1", "hash_value": "2d7dcdb10964872752bd6d081725792b3f729ac9"}]
details = self.dataset_populator.create_deferred_hda(
history_id,
"https://raw.githubusercontent.com/galaxyproject/galaxy/dev/test-data/1.bed",
ext="bed",
hashes=[{"hash_function": "SHA-1", "hash_value": "65e9d53484d28eef5447bc06fe2d754d1090975a"}],
hashes=hashes,
)
inputs = {
"input1": dataset_to_param(details),
Expand Down Expand Up @@ -2470,6 +2473,8 @@ def test_run_deferred_dataset_with_cached_input(self, history_id):
self._run_deferred(history_id)
# Should just work because input is deferred
self._run_deferred(history_id, use_cached_job=True, expect_cached_job=True)
# Should fail because we don't have a hash
self._run_deferred(history_id, use_cached_job=True, expect_cached_job=False, include_correct_hash=False)

@skip_without_tool("metadata_bam")
def test_run_deferred_dataset_with_metadata_options_filter(self, history_id):
Expand Down

0 comments on commit b3ab7ac

Please sign in to comment.