Skip to content

Commit 32914f2

Browse files
committed
Add test that confirms element sorting must match
1 parent 7fb58fd commit 32914f2

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

lib/galaxy_test/api/test_tools.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,41 @@ def test_run_cat1_use_cached_job(self):
10561056
assert len(filenames) == 3, filenames
10571057
assert len(set(filenames)) <= 2, filenames
10581058

1059+
@skip_without_tool("cat_list")
1060+
@skip_without_tool("__SORTLIST__")
1061+
def test_run_cat_list_hdca_sort_order_respecrted_use_cached_job(self):
1062+
with self.dataset_populator.test_history_for(
1063+
self.test_run_cat_list_hdca_sort_order_respecrted_use_cached_job
1064+
) as history_id:
1065+
fetch_response = self.dataset_collection_populator.create_list_in_history(
1066+
history_id, wait=True, contents=[("C", "3"), ("B", "2"), ("A", "1")]
1067+
).json()
1068+
hdca_not_sorted_id = fetch_response["output_collections"][0]["id"]
1069+
result = self._run(
1070+
tool_id="__SORTLIST__",
1071+
history_id=history_id,
1072+
inputs={"input": {"src": "hdca", "id": hdca_not_sorted_id}},
1073+
assert_ok=True,
1074+
)
1075+
hdca_sorted_id = result["output_collections"][0]["id"]
1076+
self.dataset_populator.get_history_collection_details(history_id, content_id=hdca_sorted_id)
1077+
hdca_sorted = self.dataset_populator.get_history_collection_details(history_id, content_id=hdca_sorted_id)
1078+
hdca_not_sorted = self.dataset_populator.get_history_collection_details(
1079+
history_id, content_id=hdca_not_sorted_id
1080+
)
1081+
assert hdca_sorted["elements"][0]["object"]["name"] == "A"
1082+
assert hdca_not_sorted["elements"][0]["object"]["name"] == "C"
1083+
self._run("cat_list", history_id, inputs={"input1": {"src": "hdca", "id": hdca_sorted_id}}, assert_ok=True)
1084+
job = self._run(
1085+
"cat_list",
1086+
history_id,
1087+
inputs={"input1": {"src": "hdca", "id": hdca_not_sorted_id}},
1088+
assert_ok=True,
1089+
use_cached_job=True,
1090+
)
1091+
job_details = self.dataset_populator.get_job_details(job["jobs"][0]["id"], full=True).json()
1092+
assert not job_details["copied_from_job_id"]
1093+
10591094
@skip_without_tool("cat1")
10601095
@requires_new_history
10611096
def test_run_cat1_use_cached_job_from_public_history(self):

0 commit comments

Comments
 (0)