Skip to content

Commit

Permalink
Propagate "listing" in scandeps (#197)
Browse files Browse the repository at this point in the history
* Propagate "listing" in scandeps

* Add test for directory listing in scandeps.
  • Loading branch information
tetron authored Sep 22, 2016
1 parent 00fce36 commit cf241cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,8 @@ def scandeps(base, doc, reffields, urlfields, loadref):
"class": doc["class"],
"location": urlparse.urljoin(base, u)
}
if doc["class"] == "Directory" and "listing" in doc:
deps["listing"] = doc["listing"]
deps = nestdir(base, deps)
r.append(deps)

Expand Down
18 changes: 16 additions & 2 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ def test_scandeps(self):
"id": "file:///example/bar.cwl#input2",
"default": {
"class": "Directory",
"location": "file:///example/data2"
"location": "file:///example/data2",
"listing": [{
"class": "File",
"location": "file:///example/data3.txt"
}]
}
}]
}
Expand Down Expand Up @@ -165,7 +169,17 @@ def loadref(base, p):
{
"basename": "data2",
"class": "Directory",
"location": "file:///example/data2"
"location": "file:///example/data2",
"listing": [{
"basename": "data3.txt",
"class": "File",
"location": "file:///example/data3.txt"
}]
},
{
"basename": "data3.txt",
"class": "File",
"location": "file:///example/data3.txt"
}], sc)

sc = cwltool.process.scandeps(obj["id"], obj,
Expand Down

0 comments on commit cf241cd

Please sign in to comment.