Esempio n. 1
0
def _update_seven_to_eight(result):
    """Update json results from version 7 to 8.

    This update replaces the time attribute float with a TimeAttribute object,
    which stores a start time and an end time, and provides methods for getting
    total and delta.

    This value is used for both TestResult.time and TestrunResult.time_elapsed.

    """
    for test in compat.viewvalues(result['tests']):
        test['time'] = {
            'start': 0.0,
            'end': float(test['time']),
            '__type__': 'TimeAttribute'
        }

    result['time_elapsed'] = {
        'start': 0.0,
        'end': float(result['time_elapsed']),
        '__type__': 'TimeAttribute'
    }

    result['results_version'] = 8

    return result
Esempio n. 2
0
def _update_eight_to_nine(result):
    """Update json results from version 8 to 9.

    This changes the PID feild of the TestResult object to alist of Integers or
    null rather than a single integer or null.

    """
    for test in compat.viewvalues(result['tests']):
        test['pid'] = [test['pid']]

    result['results_version'] = 9

    return result
Esempio n. 3
0
def _update_eight_to_nine(result):
    """Update json results from version 8 to 9.

    This changes the PID feild of the TestResult object to alist of Integers or
    null rather than a single integer or null.

    """
    for test in compat.viewvalues(result['tests']):
        if 'pid' in test:
            test['pid'] = [test['pid']]
        else:
            test['pid'] = []

    result['results_version'] = 9

    return result
Esempio n. 4
0
def _update_seven_to_eight(result):
    """Update json results from version 7 to 8.

    This update replaces the time attribute float with a TimeAttribute object,
    which stores a start time and an end time, and provides methods for getting
    total and delta.

    This value is used for both TestResult.time and TestrunResult.time_elapsed.

    """
    for test in compat.viewvalues(result.tests):
        test.time = results.TimeAttribute(end=test.time)

    result.time_elapsed = results.TimeAttribute(end=result.time_elapsed)

    result.results_version = 8

    return result
Esempio n. 5
0
def _update_seven_to_eight(result):
    """Update json results from version 7 to 8.

    This update replaces the time attribute float with a TimeAttribute object,
    which stores a start time and an end time, and provides methods for getting
    total and delta.

    This value is used for both TestResult.time and TestrunResult.time_elapsed.

    """
    for test in compat.viewvalues(result['tests']):
        test['time'] = {'start': 0.0, 'end': float(test['time']),
                        '__type__': 'TimeAttribute'}

    result['time_elapsed'] = {'start': 0.0, 'end':
                              float(result['time_elapsed']),
                              '__type__': 'TimeAttribute'}

    result['results_version'] = 8

    return result