Skip to content

Commit

Permalink
fix sorting of coutput collection elements in test definition
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed May 3, 2020
1 parent 22e0c42 commit 3a5d621
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions lib/galaxy/tool_util/verify/interactor.py
Expand Up @@ -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"]
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/web/framework/decorators.py
Expand Up @@ -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)
Expand Down

0 comments on commit 3a5d621

Please sign in to comment.