code: def test_launch_bad_api_key(runner, monkeypatch, user):
      args = [
          "-u",
          "https://wandb.ai/mock_server_entity/test_project/runs/run",
          "--entity",
          user,
          "--queue=default",
      ]
      monkeypatch.setenv("WANDB_API_KEY", "4" * 40)
      monkeypatch.setattr(
          "wandb.sdk.internal.internal_api.Api.viewer", lambda a: False
      )
      with runner.isolated_filesystem():
          result = runner.invoke(cli.launch, args)
  
          assert (
              "Could not connect with current API-key." in result.output
          )
  
imports: import json
  from unittest.mock import Mock
  import pytest
  import wandb
  from wandb.cli import cli
  from wandb.sdk.launch.errors import LaunchError
label_desc: Use image node_id 5 for calling a global function with example usage: test_launch_bad_api_key(runner, monkeypatch, user) without return types