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

Method test_win_path_needs_curdir

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

Source from the content-addressed store, hash-verified

2606 # See GH-75586
2607 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2608 def test_win_path_needs_curdir(self):
2609 with unittest.mock.patch('_winapi.NeedCurrentDirectoryForExePath', return_value=True) as need_curdir_mock:
2610 self.assertTrue(shutil._win_path_needs_curdir('dontcare', os.X_OK))
2611 need_curdir_mock.assert_called_once_with('dontcare')
2612 need_curdir_mock.reset_mock()
2613 self.assertTrue(shutil._win_path_needs_curdir('dontcare', 0))
2614 need_curdir_mock.assert_not_called()
2615
2616 with unittest.mock.patch('_winapi.NeedCurrentDirectoryForExePath', return_value=False) as need_curdir_mock:
2617 self.assertFalse(shutil._win_path_needs_curdir('dontcare', os.X_OK))
2618 need_curdir_mock.assert_called_once_with('dontcare')
2619
2620 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2621 def test_same_dir_with_pathext_extension(self):

Callers

nothing calls this directly

Calls 5

assertTrueMethod · 0.80
assert_not_calledMethod · 0.80
assertFalseMethod · 0.80
reset_mockMethod · 0.45

Tested by

no test coverage detected