Exemple #1
0
def summarize_status(obj):
    verdict = EnumVerdict.none
    verdict_text = ResultConst.NONE
    for result in obj._data:
        if Status.get_dict_name() in result:
            if Status.get_apply_verdict_dict_name() in result[Status.get_dict_name()]:
                if result[Status.get_dict_name()][Status.get_apply_verdict_dict_name()] is False:
                    continue
        new_verdict = result[Status.get_dict_name()][Status.get_verdict_dict_name()]
        if EnumVerdict.do_override_verdict(verdict, new_verdict):
            verdict = new_verdict
            verdict_text = \
                result[Status.get_dict_name()][Status.get_verdict_text_dict_name()]

    obj._status.verdict = verdict
    if verdict == EnumVerdict.passed:
        obj._status.verdict_text = ResultConst.TEST_PASS_VERDICT_TEXT
    else:
        obj._status.verdict_text = verdict_text
Exemple #2
0
    def generate_report(self):
        result_utils.summarize_status(self)
        parent_itr_info = iterator_utils.get_parent_active_info(self._stc_result_object)
        self._info.set_data_format(self._info, EnumDataFormat.group)
        self._info.set_data_class(self._info, EnumDataClass.iteration_report)
        report = self._info.run_time_data
        if parent_itr_info and len(parent_itr_info) > 0:
            report[self._info.dict_name]['parent_iteration_info'] = parent_itr_info
        report[self._status.dict_name] = self._status.run_time_data
        report[ResultBase.get_data_dict_name()] = \
            result_utils.group_data_using_report_group(self._data)

        report_name = self.get_report_file_name(parent_itr_info)
        # add report name to info
        report[self._info.dict_name]['resultFile'] = report_name
        result_utils.generate_report_file(report_name, report)
        # return status
        status = {}
        status[Status.get_verdict_dict_name()] = self._status.verdict
        status[Status.get_verdict_text_dict_name()] = self._status._verdict_text
        status[IterationInfo.get_result_file_dict_name()] = report_name
        return status