[Python-checkins] r84891 - in python/branches/release31-maint: Lib/distutils/tests/test_dir_util.py

senthil.kumaran python-checkins at python.org
Sun Sep 19 05:12:35 CEST 2010


Author: senthil.kumaran
Date: Sun Sep 19 05:12:35 2010
New Revision: 84891
Log:
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 (2010年9月19日) | 3 lines
 
 Update the test_distutils mode test to test with umask value properly.
........
Modified:
 python/branches/release31-maint/ (props changed)
 python/branches/release31-maint/Lib/distutils/tests/test_dir_util.py
Modified: python/branches/release31-maint/Lib/distutils/tests/test_dir_util.py
==============================================================================
--- python/branches/release31-maint/Lib/distutils/tests/test_dir_util.py	(original)
+++ python/branches/release31-maint/Lib/distutils/tests/test_dir_util.py	Sun Sep 19 05:12:35 2010
@@ -53,10 +53,15 @@
 @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):
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /