def METHOD_NAME(record_pid=None,all=False):
    """ Check if the Linkset is created and a json file is returned.
    :params record-pid: record id
    """
    if all:
        records_list=list_db_published_records()
    else:
        if record_pid is None:
           raise click.ClickException(
            "You need to provide a record id or set the flag to --all.")
        else:
            records_list=[B2ShareRecord.get_record(record_pid)]
    with current_app.test_request_context('/', base_url=get_base_url()+current_app.config.get('APPLICATION_ROOT')):
        linksets_list = generate_multiple_linksets(records_list)
    with current_app.test_client() as client:
        check_linkset(client,linksets_list)