code: def test_latest_for_prefix(request):
      queue = Queue(pathlib.Path(request.node.fspath).parent)
      with mock.patch("archery.crossbow.core.Repo.repo") as mocked_repo:
          mocked_repo.branches = [
              "origin/nightly-packaging-2022-04-10-0",
              "origin/nightly-packaging-2022-04-11-0",
          ]
          with mock.patch(
              "archery.crossbow.core.Queue.get"
          ) as mocked_get:
              queue.latest_for_prefix("nightly-packaging-2022-04-10")
              mocked_get.assert_called_once_with(
                  "nightly-packaging-2022-04-10-0"
              )
  
      with mock.patch("archery.crossbow.core.Repo.repo") as mocked_repo:
          mocked_repo.branches = [
              "origin/nightly-packaging-2022-04-10-0",
              "origin/nightly-packaging-2022-04-11-0",
          ]
          with mock.patch(
              "archery.crossbow.core.Queue.get"
          ) as mocked_get:
              queue.latest_for_prefix("nightly-packaging")
              mocked_get.assert_called_once_with(
                  "nightly-packaging-2022-04-11-0"
              )
  
file_path: arrow/dev/archery/archery/crossbow/tests/test_core.py
imports: from archery.utils.source import ArrowSources
  from archery.crossbow import Config, Queue
  import pathlib
  from unittest import mock
label_desc: Use image node_id 5 for calling a global function with example usage: test_latest_for_prefix(request) without return types