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