code: def test_relative_remote(erepo_dir, tmp_dir):
      # these steps reproduce the script on this issue:
      # https://github.com/iterative/dvc/issues/2756
      with erepo_dir.chdir():
          erepo_dir.dvc_gen("file", "contents", commit="create file")
  
      upstream_dir = tmp_dir
      upstream_url = relpath(upstream_dir, erepo_dir)
      erepo_dir.add_remote(url=upstream_url)
  
      erepo_dir.dvc.push()
  
      (erepo_dir / "file").unlink()
      remove(erepo_dir.dvc.cache.local.path)
  
      url = os.fspath(erepo_dir)
  
      with external_repo(url) as repo:
          assert os.path.isabs(repo.config["remote"]["upstream"]["url"])
          assert os.path.isdir(repo.config["remote"]["upstream"]["url"])
          with repo.dvcfs.open("file") as fd:
              assert fd.read() == "contents"
  
file_path: dvc/tests/func/test_external_repo.py
imports: import os
  from dvc.repo.open_repo import CLONES
  from dvc.repo.open_repo import _external_repo
  from dvc.scm import Git
  from dvc.testing.tmp_dir import make_subrepo
  from dvc.utils import relpath
  from dvc.utils.fs import remove
  from dvc_data.hashfile.build import build
  from dvc_data.hashfile.transfer import transfer
label_desc: Use image node_id 6 for calling a global function with example usage: test_relative_remote(erepo_dir, tmp_dir) without return types