def METHOD_NAME(
    self,
    m_export_gpg,
    m_makedirs,
    m_write_file,
    m_get_release_info,
    m_exists,
    file_exists,
    entitlement,
):
    m_get_release_info.return_value = mock.MagicMock(series="example")
    m_exists.return_value = file_exists
    entitlement.setup_local_esm_repo()
    if file_exists:
        assert m_write_file.call_count == 0
        assert m_makedirs.call_count == 0
        assert m_export_gpg.call_count == 0
    else:
        assert m_write_file.call_args_list == [
            mock.call(
                os.path.normpath(
                    apt.ESM_APT_ROOTDIR
                    + entitlement.repo_list_file_tmpl.format(
                        name=entitlement.name
                    ),
                ),
                apt.ESM_REPO_FILE_CONTENT.format(
                    name=entitlement.name[4:], series="example"
                ),
            )
        ]
        assert m_makedirs.call_args_list == [
            mock.call(
                os.path.dirname(
                    os.path.normpath(
                        apt.ESM_APT_ROOTDIR
                        + apt.APT_KEYS_DIR
                        + entitlement.repo_key_file
                    ),
                ),
                exist_ok=True,
            )
        ]
        assert m_export_gpg.call_args_list == [
            mock.call(
                os.path.join(apt.KEYRINGS_DIR, entitlement.repo_key_file),
                os.path.normpath(
                    apt.ESM_APT_ROOTDIR
                    + apt.APT_KEYS_DIR
                    + entitlement.repo_key_file
                ),
            )
        ]