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

Method test_file_mode

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

Source from the content-addressed store, hash-verified

440
441 @os_helper.skip_unless_working_chmod
442 def test_file_mode(self):
443 # _mkstemp_inner creates files with the proper mode
444
445 file = self.do_create()
446 mode = stat.S_IMODE(os.stat(file.name).st_mode)
447 expected = 0o600
448 if sys.platform == 'win32':
449 # There's no distinction among 'user', 'group' and 'world';
450 # replicate the 'user' bits.
451 user = expected >> 6
452 expected = user * (1 + 8 + 64)
453 self.assertEqual(mode, expected)
454
455 @unittest.skipUnless(has_spawnl, 'os.spawnl not available')
456 @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