code: def test_queue_iter_done_task(test_queue, mocker, status):
      mock_entry = mocker.Mock(stash_rev=_foo.name)
  
      result = mocker.Mock(status=status)
  
      mocker.patch.object(
          test_queue,
          "_iter_done_tasks",
          return_value=[(result, mock_entry)],
      )
  
      if status == "FAILURE":
          assert list(test_queue.iter_failed()) == [
              QueueDoneResult(mock_entry, None)
          ]
  
      elif status == "SUCCESS":
          with pytest.raises(DvcException, match="Invalid experiment"):
              assert list(test_queue.iter_success())
  
file_path: dvc/tests/unit/repo/experiments/queue/test_celery.py
imports: import time
  import pytest
  from celery import shared_task
  from celery.result import AsyncResult
  from dvc.exceptions import DvcException
  from dvc.repo.experiments.exceptions import UnresolvedExpNamesError
  from dvc.repo.experiments.queue.base import QueueDoneResult
  from dvc.repo.experiments.queue.exceptions import CannotKillTasksError
label_desc: Use image node_id 8 for calling a global function with example usage: test_queue_iter_done_task(test_queue, mocker, status) without return types