Skip to content

Commit b3ab7ac

Browse files
committed
Test that hash is required to match equivalent inputs
1 parent 9dc3839 commit b3ab7ac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/galaxy_test/api/test_tools.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,12 +2436,15 @@ def test_group_tag_selection_multiple(self, history_id):
24362436
output_content = self.dataset_populator.get_history_dataset_content(history_id, dataset=output)
24372437
assert output_content.strip() == "123\n456\n456\n0ab"
24382438

2439-
def _run_deferred(self, history_id: str, use_cached_job=False, expect_cached_job=False):
2439+
def _run_deferred(self, history_id: str, use_cached_job=False, expect_cached_job=False, include_correct_hash=True):
2440+
hashes: Optional[List[Dict[str, str]]] = None
2441+
if include_correct_hash:
2442+
hashes = [{"hash_function": "SHA-1", "hash_value": "2d7dcdb10964872752bd6d081725792b3f729ac9"}]
24402443
details = self.dataset_populator.create_deferred_hda(
24412444
history_id,
24422445
"https://raw.githubusercontent.com/galaxyproject/galaxy/dev/test-data/1.bed",
24432446
ext="bed",
2444-
hashes=[{"hash_function": "SHA-1", "hash_value": "65e9d53484d28eef5447bc06fe2d754d1090975a"}],
2447+
hashes=hashes,
24452448
)
24462449
inputs = {
24472450
"input1": dataset_to_param(details),
@@ -2470,6 +2473,8 @@ def test_run_deferred_dataset_with_cached_input(self, history_id):
24702473
self._run_deferred(history_id)
24712474
# Should just work because input is deferred
24722475
self._run_deferred(history_id, use_cached_job=True, expect_cached_job=True)
2476+
# Should fail because we don't have a hash
2477+
self._run_deferred(history_id, use_cached_job=True, expect_cached_job=False, include_correct_hash=False)
24732478

24742479
@skip_without_tool("metadata_bam")
24752480
def test_run_deferred_dataset_with_metadata_options_filter(self, history_id):

0 commit comments

Comments
 (0)