summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-09-19 03:12:28 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-09-19 03:12:28 (GMT)
commite092ef862e90abb52f7393a961dad4bfb970899b (patch)
treeb537a7600bec95661b5bb8f9f820e52e49ec0a35 /Lib/distutils
parentb0b3bffe8b51c96f24095bdbf26b67c31403cd31 (diff)
downloadcpython-e092ef862e90abb52f7393a961dad4bfb970899b.zip
cpython-e092ef862e90abb52f7393a961dad4bfb970899b.tar.gz
cpython-e092ef862e90abb52f7393a961dad4bfb970899b.tar.bz2
Merged revisions 84889 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84889 | senthil.kumaran | 2010-09-19 08:39:54 +0530 (Sun, 19 Sep 2010) | 3 lines Update the test_distutils mode test to test with umask value properly. ........
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/tests/test_dir_util.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/distutils/tests/test_dir_util.py b/Lib/distutils/tests/test_dir_util.py
index 892a66d..a1647fb 100644
--- a/Lib/distutils/tests/test_dir_util.py
+++ b/Lib/distutils/tests/test_dir_util.py
@@ -53,10 +53,15 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
@unittest.skipIf(sys.platform.startswith('win'),
"This test is only appropriate for POSIX-like systems.")
def test_mkpath_with_custom_mode(self):
+ # Get and set the current umask value for testing mode bits.
+ umask = os.umask(0o002)
+ os.umask(umask)
mkpath(self.target, 0o700)
- self.assertEqual(stat.S_IMODE(os.stat(self.target).st_mode), 0o700)
+ self.assertEqual(
+ stat.S_IMODE(os.stat(self.target).st_mode), 0o700 & ~umask)
mkpath(self.target2, 0o555)
- self.assertEqual(stat.S_IMODE(os.stat(self.target2).st_mode), 0o555)
+ self.assertEqual(
+ stat.S_IMODE(os.stat(self.target2).st_mode), 0o555 & ~umask)
def test_create_tree_verbosity(self):