(self)
| 113 | self.assertIn(pathlib.Path(actual), candidates) |
| 114 | |
| 115 | def test_getshortpathname(self): |
| 116 | testfn = pathlib.Path(os.getenv("ProgramFiles")) |
| 117 | if not os.path.isdir(testfn): |
| 118 | raise unittest.SkipTest("require '%ProgramFiles%' to test") |
| 119 | |
| 120 | # pathlib.Path will be rejected - only str is accepted |
| 121 | with self.assertRaises(TypeError): |
| 122 | _winapi.GetShortPathName(testfn) |
| 123 | |
| 124 | actual = _winapi.GetShortPathName(os.fsdecode(testfn)) |
| 125 | |
| 126 | # Should contain "PROGRA~" but we can't predict the number |
| 127 | self.assertIsNotNone(re.match(r".\:\\PROGRA~\d", actual.upper()), actual) |
| 128 | |
| 129 | def test_namedpipe(self): |
| 130 | pipe_name = rf"\\.\pipe\LOCAL\{os_helper.TESTFN}" |
nothing calls this directly
no test coverage detected