<commit_before>import os
import sys
sys.path.append(os.path.join('..', ''))
from tago.account.dashboards import Dashboards

TOKEN = os.environ.get('TAGO_TOKEN_ACCOUNT') or '<PASSWORD>'
DEBUG_MESSAGE = 'The response to {} \n{}'

test_dashboard = Dashboards(TOKEN)

def test_create_delete():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    #######################
    # Deleting a dash
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False

def test_edit():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    #######################
    # Editing a dashboard
    ######################

    editRequest = test_dashboard.edit(createRequest['result']['dashboard'], {'label': 'NewTestDashName'})

    print DEBUG_MESSAGE.format('dash edit', editRequest)

    if editRequest:
        assert True
    else:
        assert False

    #######################
    # Deleting a dashboard
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False

def test_info():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    ######################
    # Getting dashboard Info 
    ######################

    infoRequest = test_dashboard.info(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash info', infoRequest)

    if infoRequest:
        assert True
    else:
        assert False

    #######################
    # Deleting a dashboard
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False

def test_list():
    listRequest = test_dashboard.list()

    print DEBUG_MESSAGE.format('dash list', listRequest)

    if listRequest['status']:
        assert True
    else:
        assert False

def func_callback():
    assert True

def test_listening_stop_listening():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    ###########################
    # Start listening the dash
    ###########################
    dashboard_id = createRequest['result']['dashboard']
    
    listeningResult = test_dashboard.listening(dashboard_id, func_callback, 1)
    print DEBUG_MESSAGE.format('listening', listeningResult)

    check =  "Listening to Dashboard "+dashboard_id
    if check in listeningResult:
        assert True
    else:
        assert False


    #Create a widget and pass data to it, should invoke the callback?



    ###########################
    # Stop listening the dash
    ###########################

    stopResult = test_dashboard.stopListening(dashboard_id)
    print DEBUG_MESSAGE.format('listening stop', stopResult)

    check = "Stop listening to Dashboard "+dashboard_id
    if check in stopResult:
        assert True
    else:
        assert False   


    #######################
    # Deleting a dashboard
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False

    #######################
    # DELETE WHEN DONE!!!!! JUST HERE FOR TESTING SO WE CAN SEE CONSOLE OUTPUT
    #######################
    assert False<commit_msg>removed assert false<commit_after>import os
import sys
sys.path.append(os.path.join('..', ''))
from tago.account.dashboards import Dashboards

TOKEN = os.environ.get('TAGO_TOKEN_ACCOUNT') or '<PASSWORD>'
DEBUG_MESSAGE = 'The response to {} \n{}'

test_dashboard = Dashboards(TOKEN)

def test_create_delete():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    #######################
    # Deleting a dash
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False

def test_edit():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    #######################
    # Editing a dashboard
    ######################

    editRequest = test_dashboard.edit(createRequest['result']['dashboard'], {'label': 'NewTestDashName'})

    print DEBUG_MESSAGE.format('dash edit', editRequest)

    if editRequest:
        assert True
    else:
        assert False

    #######################
    # Deleting a dashboard
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False

def test_info():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    ######################
    # Getting dashboard Info 
    ######################

    infoRequest = test_dashboard.info(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash info', infoRequest)

    if infoRequest:
        assert True
    else:
        assert False

    #######################
    # Deleting a dashboard
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False

def test_list():
    listRequest = test_dashboard.list()

    print DEBUG_MESSAGE.format('dash list', listRequest)

    if listRequest['status']:
        assert True
    else:
        assert False

def func_callback():
    assert True

def test_listening_stop_listening():
    #######################
    # Creating a dashboard
    ######################
    createRequest = test_dashboard.create({'label':'Test Dash'})

    print DEBUG_MESSAGE.format('dash create', createRequest)

    if createRequest['status']:
        assert True
    else:
        assert False

    ###########################
    # Start listening the dash
    ###########################
    dashboard_id = createRequest['result']['dashboard']
    
    listeningResult = test_dashboard.listening(dashboard_id, func_callback, 1)
    print DEBUG_MESSAGE.format('listening', listeningResult)

    check =  "Listening to Dashboard "+dashboard_id
    if check in listeningResult:
        assert True
    else:
        assert False


    #Create a widget and pass data to it, should invoke the callback?



    ###########################
    # Stop listening the dash
    ###########################

    stopResult = test_dashboard.stopListening(dashboard_id)
    print DEBUG_MESSAGE.format('listening stop', stopResult)

    check = "Stop listening to Dashboard "+dashboard_id
    if check in stopResult:
        assert True
    else:
        assert False   


    #######################
    # Deleting a dashboard
    ######################

    deleteRequest = test_dashboard.delete(createRequest['result']['dashboard'])

    print DEBUG_MESSAGE.format('dash delete', deleteRequest)

    if deleteRequest['status']:
        assert True
    else:
        assert False
{'fraction_non_alphanumeric': 0.20835155225185834, 'fraction_numerical': 0.00021862702229995628, 'mean_word_length': 3.4369544131910765, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4706117', 'n_tokens_mistral': 2408, 'n_tokens_neox': 2303, 'n_words': 570}