code: def _test_cli(mocker, *args):
      cli_args = parse_args(["list", *args])
      assert cli_args.func == CmdList
  
      cmd = cli_args.func(cli_args)
      m = mocker.patch("dvc.repo.Repo.ls")
  
      assert cmd.run() == 0
      return m
  
file_path: dvc/tests/unit/command/ls/test_ls.py
imports: import json
  from dvc.cli import parse_args
  from dvc.commands.ls import CmdList
label_desc: Use image node_id 1 for calling a global function with example usage: _test_cli(mocker) and returns: m