Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(35822)

Unified Diff: Lib/test/test_pathlib.py

Issue 19921: Path.mkdir(0, True) always fails
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/pathlib.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_pathlib.py Sun Dec 08 10:06:04 2013 +0100
+++ b/Lib/test/test_pathlib.py Sun Dec 08 12:24:02 2013 +0200
@@ -1493,7 +1493,15 @@
with self.assertRaises(OSError) as cm:
p.mkdir(parents=True)
self.assertEqual(cm.exception.errno, errno.EEXIST)
- # XXX test `mode` arg
+ # test `mode` arg
+ mode = stat.S_IMODE(p.stat().st_mode) # default mode
+ p = self.cls(BASE, 'newdirD', 'newdirE')
+ p.mkdir(0o555, parents=True)
+ self.assertTrue(p.exists())
+ self.assertTrue(p.is_dir())
+ if os.name != 'nt':
+ self.assertEqual(stat.S_IMODE(p.stat().st_mode), 0o555 & mode)
+ self.assertEqual(stat.S_IMODE(p.parent.stat().st_mode), mode)
@with_symlinks
def test_symlink_to(self):
« no previous file with comments | « Lib/pathlib.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+