code: def test_add_to_remote(mocker, dvc):
      cli_args = parse_args(
          [
              "add",
              "s3://bucket/foo",
              "--to-remote",
              "--out",
              "bar",
              "--remote",
              "remote",
          ]
      )
      assert cli_args.func == CmdAdd
  
      cmd = cli_args.func(cli_args)
      m = mocker.patch.object(cmd.repo, "add", autospec=True)
  
      assert cmd.run() == 0
  
      m.assert_called_once_with(
          ["s3://bucket/foo"],
          no_commit=False,
          glob=False,
          out="bar",
          remote="remote",
          to_remote=True,
          remote_jobs=None,
          force=False,
      )
  
imports: import logging
  from dvc.cli import parse_args
  from dvc.commands.add import CmdAdd
label_desc: Use image node_id 2 for calling a global function with example usage: test_add_to_remote(mocker, dvc) without return types