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

Method test_mode

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

Source from the content-addressed store, hash-verified

778
779 @os_helper.skip_unless_working_chmod
780 def test_mode(self):
781 # mkdtemp creates directories with the proper mode
782
783 dir = self.do_create()
784 try:
785 mode = stat.S_IMODE(os.stat(dir).st_mode)
786 mode &= 0o777 # Mask off sticky bits inherited from /tmp
787 expected = 0o700
788 if sys.platform == 'win32':
789 # There's no distinction among 'user', 'group' and 'world';
790 # replicate the 'user' bits.
791 user = expected >> 6
792 expected = user * (1 + 8 + 64)
793 self.assertEqual(mode, expected)
794 finally:
795 os.rmdir(dir)
796
797 @unittest.skipUnless(os.name == "nt", "Only on Windows.")
798 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