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 save_active_iteration_data(self):
     """Convert from Active iteration data to Iteration data
     """
     logger.info('Save active iteration data.')
     child_data = self.get_from_stc_as_dict(self.stc_property_child_iterator_data)
     if child_data:
         self._active_iteration_info.set_data_format(self._active_iteration_info,
                                                     EnumDataFormat.group)
         result = self._active_iteration_info.run_time_data
         result[self.get_data_dict_name()] = result_utils.wrap_data_as_single_group(child_data)
     else:
         result = self._active_iteration_info.run_time_data
     result[Status.get_dict_name()] = self._active_iteration_status.run_time_data
     self.append_stc_object_collection(
         self.stc_property_completed_data,
         json.dumps(result, separators=(',', ':'), sort_keys=False))
     logger.debug('Save active iteration data completed.')