def testGlob(self): component = globbing.ParsePathItem("foo*") self.assertIsInstance(component, globbing.GlobComponent) component = globbing.ParsePathItem("*") self.assertIsInstance(component, globbing.GlobComponent) component = globbing.ParsePathItem("foo ba?") self.assertIsInstance(component, globbing.GlobComponent)
def testMalformed(self): with self.assertRaises(ValueError): globbing.ParsePathItem("foo**") with self.assertRaises(ValueError): globbing.ParsePathItem("**10bar")
def testParent(self): component = globbing.ParsePathItem(os.path.pardir) self.assertIsInstance(component, globbing.ParentComponent)
def testRecursiveWithDepth(self): component = globbing.ParsePathItem("**42") self.assertIsInstance(component, globbing.RecursiveComponent) self.assertEqual(component.max_depth, 42)