def METHOD_NAME(mocker, tmpdir):
    work_dir = str(tmpdir.mkdir("work_dir"))
    mocker.patch("shutil.rmtree", side_effect=Exception)
    result = run_cekit_cache(["-v", "--work-dir", work_dir, "clear"], 1, "y\n")
    assert (
        "An error occurred while removing the artifact cache directory '{}'".format(
            os.path.join(work_dir, "cache")
        )
        in result.output
    )