bpo-40648: Test modes that file can get with chmod() on Windows
Order of tests matter second part makes testing file writable and possible to remove again.
This commit is contained in:
parent
1b97b9b0ad
commit
67c15302b0
|
@ -141,12 +141,19 @@ class TestFilemode:
|
|||
self.assertEqual(modestr, '-r--r--r--')
|
||||
self.assertEqual(self.statmod.S_IMODE(st_mode), 0o444)
|
||||
else:
|
||||
os.chmod(TESTFN, 0o500)
|
||||
st_mode, modestr = self.get_mode()
|
||||
self.assertEqual(modestr[:3], '-r-')
|
||||
self.assertS_IS("REG", st_mode)
|
||||
self.assertEqual(self.statmod.S_IMODE(st_mode), 0o444)
|
||||
|
||||
os.chmod(TESTFN, 0o700)
|
||||
st_mode, modestr = self.get_mode()
|
||||
self.assertEqual(modestr[:3], '-rw')
|
||||
self.assertS_IS("REG", st_mode)
|
||||
self.assertEqual(self.statmod.S_IFMT(st_mode),
|
||||
self.statmod.S_IFREG)
|
||||
self.assertEqual(self.statmod.S_IMODE(st_mode), 0o666)
|
||||
|
||||
def test_directory(self):
|
||||
os.mkdir(TESTFN)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Test modes that file can get with chmod() on Windows.
|
Loading…
Reference in New Issue