code: def test_tb_presigned_url_failure(mock_init, mock_client):
      mock_init.return_value = None
      resp = {"ResponseMetadata": {"HTTPStatusCode": 400}}
      attrs = {"create_presigned_domain_url.return_value": resp}
      mock_client.return_value = Mock(**attrs)
  
      tb_app = TensorBoardApp(TEST_REGION)
      tb_app.region = TEST_REGION
      tb_app._domain_id = None
      tb_app._user_profile_name = None
      tb_app._in_studio_env = False
      tb_app._sagemaker_client = boto3.client(
          "sagemaker", region_name=TEST_REGION
      )
  
      with pytest.raises(ValueError):
          tb_app.get_app_url(
              domain_id=TEST_DOMAIN,
              user_profile_name=TEST_USER_PROFILE,
              create_presigned_domain_url=True,
              open_in_default_web_browser=False,
          )
  
imports: from __future__ import absolute_import
  import json
  from unittest.mock import patch, Mock, mock_open, PropertyMock
  import boto3
  import botocore
  import pytest
  from sagemaker.interactive_apps.tensorboard import TensorBoardApp
label_desc: Use image node_id 23 for calling a global function with example usage: test_tb_presigned_url_failure(mock_init, mock_client) without return types