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

Method test_file_mode

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

Source from the content-addressed store, hash-verified

459
460 @os_helper.skip_unless_working_chmod
461 def test_file_mode(self):
462 # _mkstemp_inner creates files with the proper mode
463
464 file = self.do_create()
465 mode = stat.S_IMODE(os.stat(file.name).st_mode)
466 expected = 0o600
467 if sys.platform == 'win32':
468 # There's no distinction among 'user', 'group' and 'world';
469 # replicate the 'user' bits.
470 user = expected >> 6
471 expected = user * (1 + 8 + 64)
472 self.assertEqual(mode, expected)
473
474 @unittest.skipUnless(has_spawnl, 'os.spawnl not available')
475 @support.requires_subprocess()

Callers

nothing calls this directly

Calls 3

do_createMethod · 0.95
statMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected