def METHOD_NAME(
    self,
    canvas_api_client,
    course_copy_plugin,
    assignment,
    public_url_for_file,
):
    canvas_api_client.public_url.side_effect = [
        CanvasAPIPermissionError,
        sentinel.url,
    ]
    course_copy_plugin.find_matching_file_in_course.return_value = (
        sentinel.found_file_id
    )
    url = public_url_for_file(sentinel.file_id)
    course_copy_plugin.find_matching_file_in_course.assert_called_once_with(
        sentinel.course_id, {sentinel.file_id, sentinel.mapped_file_id}
    )
    assert (
        assignment.get_canvas_mapped_file_id(sentinel.file_id)
        == sentinel.found_file_id
    )
    assert canvas_api_client.public_url.call_args_list == [
        call(sentinel.mapped_file_id),
        call(sentinel.found_file_id),
    ]
    assert url == sentinel.url