(self)
| 2639 | |
| 2640 | @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows') |
| 2641 | def test_same_dir_without_pathext_extension(self): |
| 2642 | cmd = self.file[:-4] # without .exe extension |
| 2643 | # pathext match |
| 2644 | self.assertNormEqual(shutil.which(cmd, path=self.dir), self.filepath) |
| 2645 | self.assertNormEqual(shutil.which(cmd, path=self.dir, mode=os.F_OK), |
| 2646 | self.filepath) |
| 2647 | |
| 2648 | # without extension |
| 2649 | other_file_path = os.path.join(self.dir, cmd) |
| 2650 | self.create_file(other_file_path) |
| 2651 | |
| 2652 | # pathext match if mode contains X_OK |
| 2653 | self.assertNormEqual(shutil.which(cmd, path=self.dir), self.filepath) |
| 2654 | # full match |
| 2655 | self.assertNormEqual(shutil.which(cmd, path=self.dir, mode=os.F_OK), |
| 2656 | other_file_path) |
| 2657 | self.assertNormEqual(shutil.which(self.file, path=self.dir), self.filepath) |
| 2658 | self.assertNormEqual(shutil.which(self.file, path=self.dir, mode=os.F_OK), |
| 2659 | self.filepath) |
| 2660 | |
| 2661 | @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows') |
| 2662 | def test_dir_order_with_pathext_extension(self): |
nothing calls this directly
no test coverage detected