MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_win_path_needs_curdir

Method test_win_path_needs_curdir

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

Source from the content-addressed store, hash-verified

2580 # See GH-75586
2581 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2582 def test_win_path_needs_curdir(self):
2583 with unittest.mock.patch('_winapi.NeedCurrentDirectoryForExePath', return_value=True) as need_curdir_mock:
2584 self.assertTrue(shutil._win_path_needs_curdir('dontcare', os.X_OK))
2585 need_curdir_mock.assert_called_once_with('dontcare')
2586 need_curdir_mock.reset_mock()
2587 self.assertTrue(shutil._win_path_needs_curdir('dontcare', 0))
2588 need_curdir_mock.assert_not_called()
2589
2590 with unittest.mock.patch('_winapi.NeedCurrentDirectoryForExePath', return_value=False) as need_curdir_mock:
2591 self.assertFalse(shutil._win_path_needs_curdir('dontcare', os.X_OK))
2592 need_curdir_mock.assert_called_once_with('dontcare')
2593
2594 @unittest.skipUnless(sys.platform == "win32", 'test specific to Windows')
2595 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