code: def test_restore_pull(tmp_dir, dvc, run_copy, mocker, local_remote):
      import dvc.output as dvc_output
  
      tmp_dir.gen("foo", "foo")
      stage = run_copy("foo", "bar", name="copy-foo-bar")
  
      dvc.push(run_cache=True)
  
      mock_restore = mocker.spy(dvc.stage_cache, "restore")
      mock_run = mocker.patch("dvc.stage.run.cmd_run")
      mock_checkout = mocker.spy(dvc_output, "checkout")
  
      # removing any information that `dvc` could use to re-generate from
      (tmp_dir / "bar").unlink()
      (tmp_dir / LOCK_FILE).unlink()
      remove(stage.outs[0].cache_path)
  
      # removing local run cache
      remove(dvc.stage_cache.cache_dir)
  
      (stage,) = dvc.reproduce("copy-foo-bar", pull=True)
  
      mock_restore.assert_called_once_with(stage, pull=True, dry=False)
      mock_run.assert_not_called()
      assert mock_checkout.call_count == 2
      assert (tmp_dir / "bar").exists()
      assert not (tmp_dir / "foo").unlink()
      assert (tmp_dir / LOCK_FILE).exists()
  
file_path: dvc/tests/func/test_run_cache.py
imports: import os
  import pytest
  from funcy import first
  from dvc.dvcfile import LOCK_FILE
  from dvc.stage.cache import RunCacheNotSupported, _get_stage_hash
  from dvc.utils.fs import remove
label_desc: Use image node_id 10 for calling a global function with example usage: test_restore_pull(tmp_dir, dvc, run_copy, mocker, local_remote) without return types