Skip to content

Commit cf241cd

Browse files
authored
Propagate "listing" in scandeps (#197)
* Propagate "listing" in scandeps * Add test for directory listing in scandeps.
1 parent 00fce36 commit cf241cd

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

cwltool/process.py

+2
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,8 @@ def scandeps(base, doc, reffields, urlfields, loadref):
652652
"class": doc["class"],
653653
"location": urlparse.urljoin(base, u)
654654
}
655+
if doc["class"] == "Directory" and "listing" in doc:
656+
deps["listing"] = doc["listing"]
655657
deps = nestdir(base, deps)
656658
r.append(deps)
657659

tests/test_examples.py

+16-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ def test_scandeps(self):
131131
"id": "file:///example/bar.cwl#input2",
132132
"default": {
133133
"class": "Directory",
134-
"location": "file:///example/data2"
134+
"location": "file:///example/data2",
135+
"listing": [{
136+
"class": "File",
137+
"location": "file:///example/data3.txt"
138+
}]
135139
}
136140
}]
137141
}
@@ -165,7 +169,17 @@ def loadref(base, p):
165169
{
166170
"basename": "data2",
167171
"class": "Directory",
168-
"location": "file:///example/data2"
172+
"location": "file:///example/data2",
173+
"listing": [{
174+
"basename": "data3.txt",
175+
"class": "File",
176+
"location": "file:///example/data3.txt"
177+
}]
178+
},
179+
{
180+
"basename": "data3.txt",
181+
"class": "File",
182+
"location": "file:///example/data3.txt"
169183
}], sc)
170184

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

0 commit comments

Comments
 (0)