def METHOD_NAME(mock_file_exists):
    """
    Test DetailProfilerApp for Studio user when the notebook metadata file provided by Studio is valid.
    """
    mock_file_exists.return_value = True
    with patch("builtins.open", mock_open(read_data=TEST_NOTEBOOK_METADATA)):
        detail_profiler_app = DetailProfilerApp(TEST_REGION)
        assert detail_profiler_app.region == TEST_REGION
        assert detail_profiler_app._domain_id == TEST_DOMAIN
        assert detail_profiler_app._user_profile_name == TEST_USER_PROFILE
        assert detail_profiler_app._valid_domain_and_user is True
        # test url without job redirect
        assert detail_profiler_app.get_app_url() == BASE_URL_STUDIO_FORMAT.format(
            TEST_DOMAIN, TEST_REGION
        )
        # test url with valid job redirect
        assert detail_profiler_app.get_app_url(TEST_TRAINING_JOB) == BASE_URL_STUDIO_FORMAT.format(
            TEST_DOMAIN, TEST_REGION
        ) + REDIRECT_STUDIO_FORMAT.format(TEST_TRAINING_JOB)
        # test url with invalid job redirect
        with pytest.raises(ValueError):
            detail_profiler_app.get_app_url("invald_job_name!")