def testSimple(self): self.Touch("foo", "0") self.Touch("foo", "bar", "0") self.Touch("foo", "bar", "baz", "0") component = globbing.ParentComponent() results = list(component.Generate(self.Path("foo"))) self.assertCountEqual(results, [self.Path()]) results = list(component.Generate(self.Path("foo", "bar"))) self.assertCountEqual(results, [self.Path("foo")]) results = list(component.Generate(self.Path("foo", "bar", "baz"))) self.assertCountEqual(results, [self.Path("foo", "bar")])
def testSimple(self): filepaths = [ ("foo", "0"), ("foo", "bar", "0"), ("foo", "bar", "baz", "0"), ] component = globbing.ParentComponent() with DirHierarchy(filepaths) as hierarchy: results = list(component.Generate(hierarchy(("foo",)))) self.assertCountEqual(results, [hierarchy(())]) results = list(component.Generate(hierarchy(("foo", "bar")))) self.assertCountEqual(results, [hierarchy(("foo",))]) results = list(component.Generate(hierarchy(("foo", "bar", "baz")))) self.assertCountEqual(results, [hierarchy(("foo", "bar"))])