MCPcopy Index your code
hub / github.com/python/cpython / test_mode

Method test_mode

Lib/test/test_tempfile.py:799–814  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

797
798 @os_helper.skip_unless_working_chmod
799 def test_mode(self):
800 # mkdtemp creates directories with the proper mode
801
802 dir = self.do_create()
803 try:
804 mode = stat.S_IMODE(os.stat(dir).st_mode)
805 mode &= 0o777 # Mask off sticky bits inherited from /tmp
806 expected = 0o700
807 if sys.platform == 'win32':
808 # There's no distinction among 'user', 'group' and 'world';
809 # replicate the 'user' bits.
810 user = expected >> 6
811 expected = user * (1 + 8 + 64)
812 self.assertEqual(mode, expected)
813 finally:
814 os.rmdir(dir)
815
816 @unittest.skipUnless(os.name == "nt", "Only on Windows.")
817 def test_mode_win32(self):

Callers

nothing calls this directly

Calls 4

do_createMethod · 0.95
rmdirMethod · 0.80
statMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected