Skip to content

redo merge of Any and location support #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions cwltool/cwltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ def compare(a, b): # type: (Any, Any) -> bool
try:
if isinstance(a, dict):
if a.get("class") == "File":
if a["path"] == "Any" or b["path"] == "Any":
if "path" in a:
comp = "path"
else:
comp = "location"
if a[comp] == "Any" or b[comp] == "Any":
return True
if not (b["path"].endswith("/" + a["path"]) or ("/" not in b["path"] and a["path"] == b["path"])):
raise CompareFail(u"%s does not end with %s" %(b["path"], a["path"]))
if a[comp] and (not (b[comp].endswith("/" + a[comp])
or ("/" not in b[comp] and a[comp] == b[comp]))):
raise CompareFail(u"%s does not end with %s" %(b[comp], a[comp]))
# ignore empty collections
b = {k: v for k, v in b.iteritems()
if not isinstance(v, (list, dict)) or len(v) > 0}
if not isinstance(v, (list, dict)) or len(v) > 0}
elif a.get("class") == "Directory":
if len(a["listing"]) != len(b["listing"]):
return False
Expand Down