Esempio 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
Esempio 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
Esempio n. 3
0
 def testPathRelativising(self):
     self.assertEqual(cleanPath(self.home), "")
     self.assertEqual(cleanPath(os.path.join(self.home, "import")), "import")
Esempio n. 4
0
 def testPathNormalization(self):
     self.assertEqual(cleanPath("/tmp/"), "/tmp")
     self.assertEqual(cleanPath("/tmp//"), "/tmp")
     self.assertEqual(cleanPath("/tmp/../tmp/"), "/tmp")
Esempio n. 5
0
 def testPathRelativising(self):
     self.assertEqual(cleanPath(self.home), "")
     self.assertEqual(cleanPath(os.path.join(self.home, "import")),
                      "import")
Esempio n. 6
0
 def testPathNormalization(self):
     self.assertEqual(cleanPath("/tmp/"), "/tmp")
     self.assertEqual(cleanPath("/tmp//"), "/tmp")
     self.assertEqual(cleanPath("/tmp/../tmp/"), "/tmp")