Пример #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)
Пример #2
0
    def testMalformed(self):
        with self.assertRaises(ValueError):
            globbing.ParsePathItem("foo**")

        with self.assertRaises(ValueError):
            globbing.ParsePathItem("**10bar")
Пример #3
0
 def testParent(self):
     component = globbing.ParsePathItem(os.path.pardir)
     self.assertIsInstance(component, globbing.ParentComponent)
Пример #4
0
 def testRecursiveWithDepth(self):
     component = globbing.ParsePathItem("**42")
     self.assertIsInstance(component, globbing.RecursiveComponent)
     self.assertEqual(component.max_depth, 42)