def METHOD_NAME(
    error, mock_target_host, ssh_client, mock_paramiko_ssh_client
):
    with patch("paramiko.RSAKey.from_private_key") as mock_from_private_key:
        mock_from_private_key.side_effect = error()
        with pytest.raises(Exception):
            ssh_client.connect(mock_target_host, FULL_CREDENTIALS[6], SSH_PORT, SSH_TIMEOUT)
    mock_paramiko_ssh_client.connect.assert_not_called()
    assert not ssh_client.connected()