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

Method test_pathext_with_empty_str

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

Source from the content-addressed store, hash-verified

2533 # Issue 40592: See https://bugs.python.org/issue40592
2534 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2535 def test_pathext_with_empty_str(self):
2536 ext = '.xyz'
2537 cmd = self.to_text_type(TESTFN2)
2538 cmdext = cmd + self.to_text_type(ext)
2539 filepath = os.path.join(self.dir, cmdext)
2540 self.create_file(filepath)
2541 with os_helper.EnvironmentVarGuard() as env:
2542 env['PATHEXT'] = ext + ';' # note the ;
2543 self.assertEqual(shutil.which(cmd, path=self.dir), filepath)
2544 self.assertEqual(shutil.which(cmdext, path=self.dir), filepath)
2545
2546 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2547 def test_pathext_with_multidot_extension(self):

Callers

nothing calls this directly

Calls 3

create_fileMethod · 0.95
joinMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected