コード例 #1
0
ファイル: validators.py プロジェクト: FHNW/Products.Reflecto
    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
コード例 #2
0
ファイル: validators.py プロジェクト: FHNW/Products.Reflecto
    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
コード例 #3
0
 def testPathRelativising(self):
     self.assertEqual(cleanPath(self.home), "")
     self.assertEqual(cleanPath(os.path.join(self.home, "import")), "import")
コード例 #4
0
 def testPathNormalization(self):
     self.assertEqual(cleanPath("/tmp/"), "/tmp")
     self.assertEqual(cleanPath("/tmp//"), "/tmp")
     self.assertEqual(cleanPath("/tmp/../tmp/"), "/tmp")
コード例 #5
0
ファイル: testUtils.py プロジェクト: FHNW/Products.Reflecto
 def testPathRelativising(self):
     self.assertEqual(cleanPath(self.home), "")
     self.assertEqual(cleanPath(os.path.join(self.home, "import")),
                      "import")
コード例 #6
0
ファイル: testUtils.py プロジェクト: FHNW/Products.Reflecto
 def testPathNormalization(self):
     self.assertEqual(cleanPath("/tmp/"), "/tmp")
     self.assertEqual(cleanPath("/tmp//"), "/tmp")
     self.assertEqual(cleanPath("/tmp/../tmp/"), "/tmp")