Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    def testMalformed(self):
        with self.assertRaises(ValueError):
            globbing.ParsePathItem("foo**")

        with self.assertRaises(ValueError):
            globbing.ParsePathItem("**10bar")
Exemplo n.º 3
0
 def testParent(self):
     component = globbing.ParsePathItem(os.path.pardir)
     self.assertIsInstance(component, globbing.ParentComponent)
Exemplo n.º 4
0
 def testRecursiveWithDepth(self):
     component = globbing.ParsePathItem("**42")
     self.assertIsInstance(component, globbing.RecursiveComponent)
     self.assertEqual(component.max_depth, 42)