(self)
| 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): |
nothing calls this directly
no test coverage detected