code: def test_stage_cache_push_pull(self, tmp_dir, dvc, remote):
      tmp_dir.gen("foo", "foo")
      stage = dvc.stage.add(
          deps=["foo"],
          outs=["bar"],
          name="copy-foo-bar",
          cmd="cp foo bar",
      )
      dvc.reproduce(stage.addressing)
      assert dvc.push(run_cache=True) == 2
  
      stage_cache_dir = tmp_dir / dvc.stage_cache.cache_dir
      expected = list(stage_cache_dir.rglob("*"))
      shutil.rmtree(stage_cache_dir)
  
      dvc.pull(run_cache=True)
      assert list(stage_cache_dir.rglob("*")) == expected
  
file_path: dvc/dvc/testing/remote_tests.py
imports: import os
  import shutil
  import pytest
  from dvc.stage.cache import RunCacheNotSupported
  from dvc.utils.fs import remove
  from dvc_data.hashfile.tree import Tree
label_desc: Use image node_id 2 for calling the TestRemote obj's underlying member method code with example usage: obj.test_stage_cache_push_pull(tmp_dir, dvc, remote) without return types