@@ -205,25 +205,28 @@ def test_graph_traversal(
205205r"""
206206Create a single repository with the following delegations:
207207
208- targets
209- *.doc, *md / \ release /*/*
210- A B
211- release /x/* / \ release /y/*.zip
212- C D
208+ targets
209+ *.doc, *.md, foo-?.tgz / \ releases /*/*
210+ A B
211+ releases /x/ / \ releases /y/*.zip
212+ C D
213213
214214Test that Updater successfully finds the target files metadata,
215215traversing the delegations as expected.
216216"""
217217delegations_tree = DelegationsTestCase (
218218 delegations = [
219- DelegationTester ("targets" , "A" , paths = ["*.doc" , "*.md" ]),
219+ DelegationTester ("targets" , "A" , paths = ["*.doc" , "*.md" , "foo-?.tgz" ]),
220220 DelegationTester ("targets" , "B" , paths = ["releases/*/*" ]),
221221 DelegationTester ("B" , "C" , paths = ["releases/x/*" ]),
222222 DelegationTester ("B" , "D" , paths = ["releases/y/*.zip" ]),
223223 ],
224224 target_files = [
225225 TargetTest ("targets" , b"targetfile content" , "targetfile" ),
226226 TargetTest ("A" , b"README by A" , "README.md" ),
227+ TargetTest ("A" , b"nested README by A" , "releases/README.md" ),
228+ TargetTest ("A" , b"foo 1" , "foo-1.tgz" ),
229+ TargetTest ("A" , b"foo alpha" , "foo-alpha.tgz" ),
227230 TargetTest ("C" , b"x release by C" , "releases/x/x_v1" ),
228231 TargetTest ("D" , b"y release by D" , "releases/y/y_v1.zip" ),
229232 TargetTest ("D" , b"z release by D" , "releases/z/z_v1.zip" ),
@@ -240,6 +243,16 @@ def test_graph_traversal(
240243 "targetpath is not delegated by all roles in the chain" : TargetTestCase (
241244 "releases/z/z_v1.zip" , False , ["B" ]
242245 ),
246+ "wildcard does not match path separator" : TargetTestCase (
247+ "releases/README.md" , False , []
248+ ),
249+ "targetpath matches question mark wildcard" : TargetTestCase (
250+ "foo-1.tgz" , True , ["A" ]
251+ ),
252+ "targetpath does not match question mark wildcard" : TargetTestCase (
253+ "foo-alpha.tgz" , False , []
254+ ),
255+ "targetpath matching is case sensitive" : TargetTestCase ("README.MD" , False , []),
243256}
244257
245258
0 commit comments