Ejemplo n.º 1
0
    def __call__(self, value, *args, **kwargs):
        path=makePathAbsolute(cleanPath(value))

        try:
            if not isDirectory(path):
                return "Not a directory"
        except OSError, e:
            return e.strerror
Ejemplo n.º 2
0
    def __call__(self, value, *args, **kwargs):
        path = makePathAbsolute(cleanPath(value))

        try:
            if not isDirectory(path):
                return "Not a directory"
        except OSError, e:
            return e.strerror
Ejemplo n.º 3
0
 def testPathRelativising(self):
     self.assertEqual(cleanPath(self.home), "")
     self.assertEqual(cleanPath(os.path.join(self.home, "import")), "import")
Ejemplo n.º 4
0
 def testPathNormalization(self):
     self.assertEqual(cleanPath("/tmp/"), "/tmp")
     self.assertEqual(cleanPath("/tmp//"), "/tmp")
     self.assertEqual(cleanPath("/tmp/../tmp/"), "/tmp")
Ejemplo n.º 5
0
 def testPathRelativising(self):
     self.assertEqual(cleanPath(self.home), "")
     self.assertEqual(cleanPath(os.path.join(self.home, "import")),
                      "import")
Ejemplo n.º 6
0
 def testPathNormalization(self):
     self.assertEqual(cleanPath("/tmp/"), "/tmp")
     self.assertEqual(cleanPath("/tmp//"), "/tmp")
     self.assertEqual(cleanPath("/tmp/../tmp/"), "/tmp")