code: def test_docker_run_only_pulling_and_building(build, pull):
      args = ["run", "ubuntu-cpp", "--build-only"]
      result = CliRunner().invoke(docker, args)
      assert result.exit_code == 0
      pull.assert_called_once_with(
          "ubuntu-cpp", pull_leaf=True, using_docker=False
      )
      build.assert_called_once_with(
          "ubuntu-cpp",
          use_cache=True,
          use_leaf_cache=True,
          using_docker=False,
          using_buildx=False,
      )
  
file_path: arrow/dev/archery/archery/docker/tests/test_docker_cli.py
imports: from unittest.mock import patch
  from click.testing import CliRunner
  from archery.docker import DockerCompose
  from archery.docker.cli import docker
label_desc: Use image node_id 5 for calling a global function with example usage: test_docker_run_only_pulling_and_building(build, pull) without return types