MCPcopy Index your code
hub / github.com/python/cpython / test_same_dir_with_pathext_extension

Method test_same_dir_with_pathext_extension

Lib/test/test_shutil.py:2621–2638  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2619
2620 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2621 def test_same_dir_with_pathext_extension(self):
2622 cmd = self.file # with .exe extension
2623 # full match
2624 self.assertNormEqual(shutil.which(cmd, path=self.dir), self.filepath)
2625 self.assertNormEqual(shutil.which(cmd, path=self.dir, mode=os.F_OK),
2626 self.filepath)
2627
2628 cmd2 = cmd + self.to_text_type('.com') # with .exe.com extension
2629 other_file_path = os.path.join(self.dir, cmd2)
2630 self.create_file(other_file_path)
2631
2632 # full match
2633 self.assertNormEqual(shutil.which(cmd, path=self.dir), self.filepath)
2634 self.assertNormEqual(shutil.which(cmd, path=self.dir, mode=os.F_OK),
2635 self.filepath)
2636 self.assertNormEqual(shutil.which(cmd2, path=self.dir), other_file_path)
2637 self.assertNormEqual(shutil.which(cmd2, path=self.dir, mode=os.F_OK),
2638 other_file_path)
2639
2640 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2641 def test_same_dir_without_pathext_extension(self):

Callers

nothing calls this directly

Calls 3

assertNormEqualMethod · 0.95
create_fileMethod · 0.95
joinMethod · 0.45

Tested by

no test coverage detected