code: def test_detail_profiler_init_with_default_region():
      """
      Test DetailProfilerApp init when user does not provide region.
      """
      # happy case
      with patch(
          "sagemaker.Session.boto_region_name",
          new_callable=PropertyMock,
      ) as region_mock:
          region_mock.return_value = TEST_REGION
          detail_profiler_app = DetailProfilerApp()
          assert detail_profiler_app.region == TEST_REGION
  
      # no default region configured
      with patch(
          "sagemaker.Session.boto_region_name",
          new_callable=PropertyMock,
      ) as region_mock:
          region_mock.side_effect = [ValueError()]
          with pytest.raises(ValueError):
              detail_profiler_app = DetailProfilerApp()
  
file_path: sagemaker-python-sdk/tests/unit/test_profiler_app.py
imports: from __future__ import absolute_import
  from sagemaker.interactive_apps.detail_profiler_app import DetailProfilerApp
  from unittest.mock import patch, mock_open, PropertyMock
  import json
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_detail_profiler_init_with_default_region() without return types