示例#1
0
  def testMultiRangeClass(self):
    filepaths = [
        ("f00",),
        ("b4R",),
        ("8az",),
        ("quux",),
    ]

    component = globbing.GlobComponent("[a-z][a-z0-9]*")

    with DirHierarchy(filepaths) as hierarchy:
      results = list(component.Generate(hierarchy(())))
      self.assertCountEqual(results, [
          hierarchy(("f00",)),
          hierarchy(("b4R",)),
          hierarchy(("quux",)),
      ])
示例#2
0
 def testGlobComponentGenerateWorksWithTSK(self):
     opts = globbing.PathOpts(pathtype=rdf_paths.PathSpec.PathType.TSK)
     paths = globbing.GlobComponent(u"Windows", opts=opts).Generate("C:\\")
     self.assertEqual(list(paths), [u"C:\\Windows"])