def test_fname_exists_false(self, path_mocker_stopall):
# mock
mock_path = path_mocker_stopall.MagicMock(name="mock_path")
# patch
path_mocker_stopall.patch.object(scarlett_os.internal.path, 'Path', mock_path)
path = '/home/pi/dev/bossjones-github/scarlett_os/_debug/generator.dot'
mock_path_instance = mock_path()
mock_path_instance.exists.return_value = False
# run test
result = s_path.fname_exists(path)
assert mock_path_instance.exists.call_count == 1
mock_path_instance.exists.assert_called_once_with()
mock_path.assert_any_call(path)
assert result == False
评论列表
文章目录