code: def test_restore_bad_remote(
      runner, mock_server, git_repo, docker, monkeypatch
  ):
      # git_repo creates its own isolated filesystem
      mock_server.set_context(
          "git", {"repo": "http://fake.git/foo/bar"}
      )
      api = InternalApi({"project": "test"})
      monkeypatch.setattr(cli, "_api", api)
  
      def bad_commit(cmt):
          raise ValueError()
  
      monkeypatch.setattr(api.git.repo, "commit", bad_commit)
      monkeypatch.setattr(
          api, "download_urls", lambda *args, **kwargs: []
      )
      result = runner.invoke(cli.restore, ["wandb/test:abcdef"])
      print(result.output)
      print(traceback.print_tb(result.exc_info[2]))
      assert result.exit_code == 1
      assert "Run `git clone http://fake.git/foo/bar`" in result.output
  
file_path: wandb/tests/pytest_tests/unit_tests_old/test_core/test_cli.py
imports: import os
  import platform
  import subprocess
  import traceback
  import pytest
  import wandb
  from wandb.apis.internal import InternalApi
  from wandb.cli import cli
label_desc: Use image node_id 3 for calling a global function with example usage: test_restore_bad_remote(runner, mock_server, git_repo, docker, monkeypatch) without return types