"""Tests for distutils.dir_util."""
import unittest
import os
+import stat
import shutil
from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree,
wanted = ["removing '%s' (and everything under it)" % self.root_target]
self.assertEquals(self._logs, wanted)
+ def test_mkpath_with_custom_mode(self):
+ mkpath(self.target, 0o700)
+ self.assertEqual(stat.S_IMODE(os.stat(self.target).st_mode), 0o700)
+ mkpath(self.target2, 0o555)
+ self.assertEqual(stat.S_IMODE(os.stat(self.target2).st_mode), 0o555)
+
def test_create_tree_verbosity(self):
create_tree(self.root_target, ['one', 'two', 'three'], verbose=0)