summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-08-09 18:13:51 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-08-09 18:13:51 (GMT)
commitca3ac7f639cf48629b896ffc88b3be9308bf6596 (patch)
treee14009ed49a3e89e91b3e9d40d7f6dc51d0e2539 /Lib
parenta0d55de8773559568e57cf01445eb6a9011ad5dd (diff)
downloadcpython-ca3ac7f639cf48629b896ffc88b3be9308bf6596.zip
cpython-ca3ac7f639cf48629b896ffc88b3be9308bf6596.tar.gz
cpython-ca3ac7f639cf48629b896ffc88b3be9308bf6596.tar.bz2
There's no distinction among 'user', 'group' and 'world' permissions
on Win32, so tests that assume there are such distinctions can't pass. Fiddled them to work.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_tempfile.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index fd7e9d0..09d30ab 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -309,7 +309,13 @@ class test__mkstemp_inner(TC):
file = self.do_create()
mode = stat.S_IMODE(os.stat(file.name).st_mode)
- self.assertEqual(mode, 0600)
+ expected = 0600
+ if sys.platform in ('win32',):
+ # There's no distinction among 'user', 'group' and 'world';
+ # replicate the 'user' bits.
+ user = expected >> 6
+ expected = user * (1 + 8 + 64)
+ self.assertEqual(mode, expected)
def test_noinherit(self):
"""_mkstemp_inner file handles are not inherited by child processes"""
@@ -513,7 +519,13 @@ class test_mkdtemp(TC):
dir = self.do_create()
try:
mode = stat.S_IMODE(os.stat(dir).st_mode)
- self.assertEqual(mode, 0700)
+ expected = 0700
+ if sys.platform in ('win32',):
+ # There's no distinction among 'user', 'group' and 'world';
+ # replicate the 'user' bits.
+ user = expected >> 6
+ expected = user * (1 + 8 + 64)
+ self.assertEqual(mode, expected)
finally:
os.rmdir(dir)