code: def setup_class(cls) -> None:
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_NO_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=None,
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra='{"compress" : true, "no_host_key_check" : "true", "allow_host_key_change": false}',
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_EXTRA_FALSE_LOOK_FOR_KEYS,
              host="localhost",
              conn_type="ssh",
              extra='{"compress" : true, "no_host_key_check" : "true", '
              '"allow_host_key_change": false, "look_for_keys": false}',
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_PRIVATE_KEY_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps({"private_key": TEST_PRIVATE_KEY}),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_PRIVATE_KEY_PASSPHRASE_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_ENCRYPTED_PRIVATE_KEY,
                      "private_key_passphrase": PASSPHRASE,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_PRIVATE_KEY_ECDSA_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps({"private_key": TEST_PRIVATE_KEY_ECDSA}),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_TIMEOUT_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps({"timeout": TEST_TIMEOUT}),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_CONN_TIMEOUT_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps({"conn_timeout": TEST_CONN_TIMEOUT}),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_TIMEOUT_AND_CONN_TIMEOUT_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "conn_timeout": TEST_CONN_TIMEOUT,
                      "timeout": TEST_TIMEOUT,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_CMD_TIMEOUT_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps({"cmd_timeout": TEST_CMD_TIMEOUT_EXTRA}),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_NULL_CMD_TIMEOUT_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps({"cmd_timeout": None}),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_HOST_KEY_EXTRA,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_PRIVATE_KEY,
                      "host_key": TEST_HOST_KEY,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_HOST_KEY_EXTRA_WITH_TYPE,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_PRIVATE_KEY,
                      "host_key": "ssh-rsa " + TEST_HOST_KEY,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_HOST_KEY_AND_NO_HOST_KEY_CHECK_FALSE,
              host="remote_host",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_PRIVATE_KEY,
                      "host_key": TEST_HOST_KEY,
                      "no_host_key_check": False,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_HOST_KEY_AND_NO_HOST_KEY_CHECK_TRUE,
              host="remote_host",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_PRIVATE_KEY,
                      "host_key": TEST_HOST_KEY,
                      "no_host_key_check": True,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_NO_HOST_KEY_AND_NO_HOST_KEY_CHECK_FALSE,
              host="remote_host",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_PRIVATE_KEY,
                      "no_host_key_check": False,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_NO_HOST_KEY_AND_NO_HOST_KEY_CHECK_TRUE,
              host="remote_host",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_PRIVATE_KEY,
                      "no_host_key_check": True,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_HOST_KEY_AND_ALLOW_HOST_KEY_CHANGES_TRUE,
              host="remote_host",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "private_key": TEST_PRIVATE_KEY,
                      "host_key": TEST_HOST_KEY,
                      "allow_host_key_change": True,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_EXTRA_DISABLED_ALGORITHMS,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps(
                  {"disabled_algorithms": TEST_DISABLED_ALGORITHMS}
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_EXTRA_CIPHERS,
              host="localhost",
              conn_type="ssh",
              extra=json.dumps({"ciphers": TEST_CIPHERS}),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_NO_HOST_KEY_CHECK_TRUE_AND_ALLOW_HOST_KEY_CHANGES_TRUE,
              host="remote_host",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "no_host_key_check": True,
                      "allow_host_key_change": True,
                  }
              ),
          )
      )
      db.merge_conn(
          Connection(
              conn_id=cls.CONN_SSH_WITH_NO_HOST_KEY_CHECK_TRUE_AND_ALLOW_HOST_KEY_CHANGES_FALSE,
              host="remote_host",
              conn_type="ssh",
              extra=json.dumps(
                  {
                      "no_host_key_check": True,
                      "allow_host_key_change": False,
                  }
              ),
          )
      )
  
imports: from __future__ import annotations
  import json
  import random
  import string
  import textwrap
  from io import StringIO
  from unittest import mock
  import paramiko
  import pytest
  from airflow import settings
  from airflow.exceptions import AirflowException
  from airflow.models import Connection
  from airflow.providers.ssh.hooks.ssh import SSHHook
  from airflow.utils import db
  from airflow.utils.session import create_session
label_desc: Use image node_id 2 for calling the TestSSHHook obj's underlying member method code with example usage: obj.setup_class(cls) without return types