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