open-cas-linux/test/functional/test-framework/log/html_setup_log.py
Robert Baldyga 849f59855c tests: Embed test framework within OCL repository
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-12-23 12:53:55 +01:00

35 lines
1.2 KiB
Python

#
# Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
from log.html_file_item_log import HtmlFileItemLog
from log.base_log import BaseLogResult
class HtmlSetupLog(HtmlFileItemLog):
LOG_RESULT = {
BaseLogResult.PASSED: HtmlFileItemLog.info,
BaseLogResult.WORKAROUND: HtmlFileItemLog.workaround,
BaseLogResult.WARNING: HtmlFileItemLog.warning,
BaseLogResult.SKIPPED: HtmlFileItemLog.skip,
BaseLogResult.FAILED: HtmlFileItemLog.error,
BaseLogResult.BLOCKED: HtmlFileItemLog.blocked,
BaseLogResult.EXCEPTION: HtmlFileItemLog.exception,
BaseLogResult.CRITICAL: HtmlFileItemLog.critical}
def __init__(self, test_title, config, iteration_title="Test summary"):
html_file_path = config.get_setup_file_path()
super().__init__(html_file_path, test_title, config, iteration_title)
self._last_iteration_title = ''
def start_iteration(self, message):
self._last_iteration_title = message
def end_iteration(self, iteration_result):
HtmlSetupLog.LOG_RESULT[iteration_result](self, self._last_iteration_title)
def end(self):
super().end()