code: def connect_invalid():
      current = h2o.connection()
  
      print(current._auth)
  
      if current._auth is None:
          print(
              "Skipping test running in non-authenticated environment"
          )
          return
  
      invalid = copy.copy(current)
  
      # Not invalid yet - first do sanity check that original connection can be used to make a request
      invalid.request("GET /3/About")
  
      auth_user = (
          invalid._auth[0]
          if isinstance(invalid._auth, tuple)
          else "jenkins"
      )  # fallback for CI testing
      invalid._auth = (auth_user, "invalid-password")
  
      # Test with invalid basic auth
      err = None
      try:
          invalid._auth = ("invalid-user", "invalid-password")
          invalid.request("GET /3/About")
      except H2OServerError as e:
          err = e
  
      assert err is not None
  
      msg = str(err.args[0])
      print("<Error message>")
      print(msg)
      print("</Error Message>")
  
      assert msg.startswith("HTTP 401")  # Unauthorized
  
      # Test without any auth
      err = None
      try:
          invalid._auth = None
          invalid.request("GET /3/About")
      except H2OServerError as e:
          err = e
  
      assert err is not None
  
      msg = str(err.args[0])
      print("<Error message>")
      print(msg)
      print("</Error Message>")
  
      assert msg.startswith("HTTP 401")
  
imports: import sys
  import os
  import h2o
  from h2o.exceptions import H2OServerError
  from tests import pyunit_utils
  import copy
label_desc: Use image node_id 1 for calling a global function with example usage: connect_invalid() without return types