(self)
| 1003 | |
| 1004 | @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") |
| 1005 | def test_access_denied(self): |
| 1006 | # Default to FindFirstFile WIN32_FIND_DATA when access is |
| 1007 | # denied. See issue 28075. |
| 1008 | # os.environ['TEMP'] should be located on a volume that |
| 1009 | # supports file ACLs. |
| 1010 | fname = os.path.join(os.environ['TEMP'], self.fname + "_access") |
| 1011 | self.addCleanup(os_helper.unlink, fname) |
| 1012 | create_file(fname, b'ABC') |
| 1013 | # Deny the right to [S]YNCHRONIZE on the file to |
| 1014 | # force CreateFile to fail with ERROR_ACCESS_DENIED. |
| 1015 | DETACHED_PROCESS = 8 |
| 1016 | subprocess.check_call( |
| 1017 | # bpo-30584: Use security identifier *S-1-5-32-545 instead |
| 1018 | # of localized "Users" to not depend on the locale. |
| 1019 | ['icacls.exe', fname, '/deny', '*S-1-5-32-545:(S)'], |
| 1020 | creationflags=DETACHED_PROCESS |
| 1021 | ) |
| 1022 | result = os.stat(fname) |
| 1023 | self.assertNotEqual(result.st_size, 0) |
| 1024 | self.assertTrue(os.path.isfile(fname)) |
| 1025 | |
| 1026 | @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") |
| 1027 | def test_stat_block_device(self): |
nothing calls this directly
no test coverage detected