(self)
| 2557 | |
| 2558 | @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows') |
| 2559 | def test_pathext_with_null_extension(self): |
| 2560 | cmd = self.to_text_type(TESTFN2) |
| 2561 | cmddot = cmd + self.to_text_type('.') |
| 2562 | filepath = os.path.join(self.dir, cmd) |
| 2563 | self.create_file(filepath) |
| 2564 | with os_helper.EnvironmentVarGuard() as env: |
| 2565 | env['PATHEXT'] = '.xyz' |
| 2566 | self.assertIsNone(shutil.which(cmd, path=self.dir)) |
| 2567 | self.assertIsNone(shutil.which(cmddot, path=self.dir)) |
| 2568 | env['PATHEXT'] = '.xyz;.' # note the . |
| 2569 | self.assertEqual(shutil.which(cmd, path=self.dir), filepath) |
| 2570 | self.assertEqual(shutil.which(cmddot, path=self.dir), |
| 2571 | filepath + self.to_text_type('.')) |
| 2572 | env['PATHEXT'] = '.xyz;..' # multiple dots |
| 2573 | self.assertEqual(shutil.which(cmd, path=self.dir), filepath) |
| 2574 | self.assertEqual(shutil.which(cmddot, path=self.dir), |
| 2575 | filepath + self.to_text_type('.')) |
| 2576 | |
| 2577 | @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows') |
| 2578 | def test_pathext_extension_ends_with_dot(self): |
nothing calls this directly
no test coverage detected