code: def test_fname_changes_path_and_wdir(self, tmp_dir, dvc):
      dirpath = tmp_dir / "dir"
      dirpath.mkdir()
  
      with dirpath.chdir():
          stage = dvc.run(
              cmd="echo test > foo",
              outs=["foo"],
              wdir=os.fspath(tmp_dir),
              name="echo",
          )
      assert stage.wdir == os.path.realpath(tmp_dir)
  
      # Check that it is dumped properly
      d = load_yaml("dir/dvc.yaml")
      assert get_in(d, ["stages", "echo", "wdir"]) == ".."
  
imports: import logging
  import os
  import textwrap
  import uuid
  import pytest
  from funcy import get_in
  from dvc.cli import main
  from dvc.dependency import ParamsDependency
  from dvc.dependency.base import DependencyDoesNotExistError
  from dvc.dvcfile import LOCK_FILE, PROJECT_FILE, load_file
  from dvc.exceptions import ArgumentDuplicationError, CircularDependencyError, CyclicGraphError, InvalidArgumentError, OutputDuplicationError, OverlappingOutputPathsError
  from dvc.stage import PipelineStage
  from dvc.stage.exceptions import DuplicateStageName, InvalidStageName, StagePathNotDirectoryError, StagePathNotFoundError, StagePathOutsideError
  from dvc.utils.serialize import load_yaml
label_desc: Use image node_id 2 for calling the TestCmdRunWorkingDirectory obj's underlying member method code with example usage: obj.test_fname_changes_path_and_wdir(tmp_dir, dvc) without return types