How to call this function of Python? Not sure what the values of the three arguments need to be

60 views Asked by At

How do I call the following function. I am not sure of what to pass in the arguments mentioned in the function. I know the question is very basic but any help is much appriciated.

def mem_info_detail(mem_dict, test_num, summary_dict, table_name=SSP_TABLE_NAME['test_mem']):
    """
    Function to generate message with mem_test details.

    Args:
        mem_dict          : Dictionary    : Output of memtest parser
        table_name        : String        : Name of table in Database

    Returns:
        param_mem_dict    : Dictionary    : Dictionary with memtest details

    Raises:
        None
    """
    start_time = (mem_dict.get('Result summary', {}).get(
        'Test Start Time', 'NULL')).encode('utf-8')
    elapse_time = (mem_dict.get('Result summary', {}).get(
        'Elapsed Time', 'NULL')).encode('utf-8')
    test_num = int(test_num)
    tot_iters = int(summary_dict.get('Test Passed')[1])
    iters_passed = int(summary_dict.get('Test Passed')[0])
    errors = (int(summary_dict.get('Errors')))
    memory = int(((mem_dict.get("Result summary").get(
        "Memory Range Tested")).split('('))[1].strip('MB)'))

    param_mem_dict = {
        'message_name': table_name,
        'EVENTTIME': get_event_date(),
        'STARTTIME': start_time,
        'ELAPSEDTIME': elapse_time,
        'TESTNO': test_num,
        'ITERATIONS': tot_iters,
        'ITERPASSED': iters_passed,
        'ERRORS': errors,
        'MEMORY': memory}
    return param_mem_dict
1

There are 1 answers

0
guidot On

Obviously the contained documentation is no longer up to date.

You have to provide at least three arguments, i. e. one per each parameter not having a default value, so summary_dict is missing from description.