MCPcopy Create free account
hub / github.com/python/cpython / test_file_permissions

Method test_file_permissions

Lib/test/test_mailbox.py:982–992  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

980
981 @unittest.skipUnless(hasattr(os, 'umask'), 'test needs os.umask()')
982 def test_file_permissions(self):
983 # Verify that message files are created without execute permissions
984 msg = mailbox.MaildirMessage(self._template % 0)
985 orig_umask = os.umask(0)
986 try:
987 key = self._box.add(msg)
988 finally:
989 os.umask(orig_umask)
990 path = os.path.join(self._path, self._box._lookup(key))
991 mode = os.stat(path).st_mode
992 self.assertFalse(mode & 0o111)
993
994 @unittest.skipUnless(hasattr(os, 'umask'), 'test needs os.umask()')
995 def test_folder_file_perms(self):

Callers

nothing calls this directly

Calls 5

assertFalseMethod · 0.80
addMethod · 0.45
joinMethod · 0.45
_lookupMethod · 0.45
statMethod · 0.45

Tested by

no test coverage detected