Example #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)
Example #2
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)
Example #3
0
 def test_directory_exists_no_mode(self):
     with namedTemporaryDir() as base:
         fileUtils.createdir(base)
Example #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))
Example #5
0
 def test_directory_exists_no_mode(self):
     with namedTemporaryDir() as base:
         fileUtils.createdir(base)
Example #6
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))