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

Method test_pathext_extension_ends_with_dot

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

Source from the content-addressed store, hash-verified

2576
2577 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2578 def test_pathext_extension_ends_with_dot(self):
2579 ext = '.xyz'
2580 cmd = self.to_text_type(TESTFN2)
2581 cmdext = cmd + self.to_text_type(ext)
2582 dot = self.to_text_type('.')
2583 filepath = os.path.join(self.dir, cmdext)
2584 self.create_file(filepath)
2585 with os_helper.EnvironmentVarGuard() as env:
2586 env['PATHEXT'] = ext + '.'
2587 self.assertEqual(shutil.which(cmd, path=self.dir), filepath) # cmd.exe hangs here
2588 self.assertEqual(shutil.which(cmdext, path=self.dir), filepath)
2589 self.assertIsNone(shutil.which(cmd + dot, path=self.dir))
2590 self.assertIsNone(shutil.which(cmdext + dot, path=self.dir))
2591
2592 # See GH-75586
2593 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')

Callers

nothing calls this directly

Calls 4

create_fileMethod · 0.95
assertIsNoneMethod · 0.80
joinMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected