コード例 #1
0
 def test_create_dirs_with_mode(self):
     with namedTemporaryDir() as base:
         path = os.path.join(base, "a", "b")
         mode = 0o700
         fileUtils.createdir(path, mode=mode)
         self.assertTrue(os.path.isdir(path))
         while path != base:
             pathmode = stat.S_IMODE(os.lstat(path).st_mode)
             self.assertEqual(pathmode, mode)
             path = os.path.dirname(path)
コード例 #2
0
ファイル: fileUtilTests.py プロジェクト: Caez83/vdsm
 def test_create_dirs_with_mode(self):
     with namedTemporaryDir() as base:
         path = os.path.join(base, "a", "b")
         mode = 0o700
         fileUtils.createdir(path, mode=mode)
         self.assertTrue(os.path.isdir(path))
         while path != base:
             pathmode = stat.S_IMODE(os.lstat(path).st_mode)
             self.assertEqual(pathmode, mode)
             path = os.path.dirname(path)
コード例 #3
0
 def test_directory_exists_no_mode(self):
     with namedTemporaryDir() as base:
         fileUtils.createdir(base)
コード例 #4
0
 def test_create_dirs_no_mode(self):
     with namedTemporaryDir() as base:
         path = os.path.join(base, "a", "b")
         self.assertFalse(os.path.isdir(path))
         fileUtils.createdir(path)
         self.assertTrue(os.path.isdir(path))
コード例 #5
0
ファイル: fileUtilTests.py プロジェクト: Caez83/vdsm
 def test_directory_exists_no_mode(self):
     with namedTemporaryDir() as base:
         fileUtils.createdir(base)
コード例 #6
0
ファイル: fileUtilTests.py プロジェクト: Caez83/vdsm
 def test_create_dirs_no_mode(self):
     with namedTemporaryDir() as base:
         path = os.path.join(base, "a", "b")
         self.assertFalse(os.path.isdir(path))
         fileUtils.createdir(path)
         self.assertTrue(os.path.isdir(path))