diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py index d9c3b29c99d2..3897cadd41ac 100644 --- a/lib/galaxy/tool_util/verify/interactor.py +++ b/lib/galaxy/tool_util/verify/interactor.py @@ -692,12 +692,6 @@ def verify_extra_files(extra_files): def verify_collection(output_collection_def, data_collection, verify_dataset): name = output_collection_def.name - def get_element(elements, id): - for element in elements: - if element["element_identifier"] == id: - return element - return False - expected_collection_type = output_collection_def.collection_type if expected_collection_type: collection_type = data_collection["collection_type"] @@ -715,15 +709,23 @@ def get_element(elements, id): raise AssertionError(message) def verify_elements(element_objects, element_tests): + i = 0 for element_identifier, element_test in element_tests.items(): if isinstance(element_test, dict): element_outfile, element_attrib = None, element_test else: element_outfile, element_attrib = element_test - element = get_element(element_objects, element_identifier) - if not element: - template = "Failed to find identifier [%s] for testing, tool generated collection elements [%s]" + element = None + while i < len(element_objects): + if element_objects[i]["element_identifier"] == element_identifier: + element = element_objects[i] + i += 1 + break + i += 1 + + if element is None: + template = "Failed to find identifier [%s] for testing or elements in wrong order, tool generated collection elements [%s]" message = template % (element_identifier, element_objects) raise AssertionError(message) diff --git a/lib/galaxy/web/framework/decorators.py b/lib/galaxy/web/framework/decorators.py index 851ebd101921..f575cd8a5e74 100644 --- a/lib/galaxy/web/framework/decorators.py +++ b/lib/galaxy/web/framework/decorators.py @@ -326,7 +326,7 @@ def format_return_as_json(rval, jsonp_callback=None, pretty=False): Use `pretty=True` to return pretty printed json. """ - dumps_kwargs = dict(indent=4, sort_keys=True) if pretty else {} + dumps_kwargs = dict(indent=4) if pretty else {} json = safe_dumps(rval, **dumps_kwargs) if jsonp_callback: json = "{}({});".format(jsonp_callback, json)