summaryrefslogtreecommitdiff
path: root/tests/test_dir_util.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-09-17 16:35:37 +0000
committerSenthil Kumaran <orsenthil@gmail.com>2010-09-17 16:35:37 +0000
commitfdc07fb43978baae1dbe06a43707d5c81a14d1db (patch)
tree531dee5fe5475ddff084a90ed93ef94c977e195b /tests/test_dir_util.py
parentc9bc9d98d8766b49eea3d8fbc084e9313094b94e (diff)
downloadpython-setuptools-git-fdc07fb43978baae1dbe06a43707d5c81a14d1db.tar.gz
Fix Issue2236: Distutils' mkpath implementation ignoring the "mode" parameter
Diffstat (limited to 'tests/test_dir_util.py')
-rw-r--r--tests/test_dir_util.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_dir_util.py b/tests/test_dir_util.py
index 0f694aa0..8986ca55 100644
--- a/tests/test_dir_util.py
+++ b/tests/test_dir_util.py
@@ -1,6 +1,7 @@
"""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,
@@ -48,6 +49,12 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
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)