MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_file_permissions

Method test_file_permissions

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

Source from the content-addressed store, hash-verified

974
975 @unittest.skipUnless(hasattr(os, 'umask'), 'test needs os.umask()')
976 def test_file_permissions(self):
977 # Verify that message files are created without execute permissions
978 msg = mailbox.MaildirMessage(self._template % 0)
979 orig_umask = os.umask(0)
980 try:
981 key = self._box.add(msg)
982 finally:
983 os.umask(orig_umask)
984 path = os.path.join(self._path, self._box._lookup(key))
985 mode = os.stat(path).st_mode
986 self.assertFalse(mode & 0o111)
987
988 @unittest.skipUnless(hasattr(os, 'umask'), 'test needs os.umask()')
989 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