本文整理汇总了Python中bzt.modules.reporting.FinalStatus.prepare方法的典型用法代码示例。如果您正苦于以下问题:Python FinalStatus.prepare方法的具体用法?Python FinalStatus.prepare怎么用?Python FinalStatus.prepare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bzt.modules.reporting.FinalStatus
的用法示例。
在下文中一共展示了FinalStatus.prepare方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_log_messages_duration
# 需要导入模块: from bzt.modules.reporting import FinalStatus [as 别名]
# 或者: from bzt.modules.reporting.FinalStatus import prepare [as 别名]
def test_log_messages_duration(self):
"""
Test duration report
:return:
"""
obj = FinalStatus()
obj.parameters = BetterDict()
obj.log = logger_mock()
obj.prepare()
obj.start_time -= 120005
obj.post_process()
self.assertEqual("Test duration: 1 day, 9:20:05\n", obj.log.info_buf.getvalue())
示例2: test_log_messages_duration
# 需要导入模块: from bzt.modules.reporting import FinalStatus [as 别名]
# 或者: from bzt.modules.reporting.FinalStatus import prepare [as 别名]
def test_log_messages_duration(self):
"""
Test duration report
:return:
"""
obj = FinalStatus()
obj.parameters = BetterDict()
log_recorder = RecordingHandler()
obj.log.addHandler(log_recorder)
obj.prepare()
obj.start_time -= 120005
obj.post_process()
self.assertEqual("Test duration: 1 day, 9:20:05\n", log_recorder.info_buff.getvalue())
obj.log.removeHandler(log_recorder)
示例3: test_log_messages_duration
# 需要导入模块: from bzt.modules.reporting import FinalStatus [as 别名]
# 或者: from bzt.modules.reporting.FinalStatus import prepare [as 别名]
def test_log_messages_duration(self):
"""
Test duration report
:return:
"""
obj = FinalStatus()
obj.engine = EngineEmul()
obj.parameters = BetterDict()
self.sniff_log(obj.log)
obj.prepare()
obj.startup()
obj.shutdown()
obj.start_time -= 120005
obj.post_process()
self.assertEqual("Test duration: 1 day, 9:20:05\n", self.log_recorder.info_buff.getvalue())
示例4: test_func_report_all_no_stacktrace
# 需要导入模块: from bzt.modules.reporting import FinalStatus [as 别名]
# 或者: from bzt.modules.reporting.FinalStatus import prepare [as 别名]
def test_func_report_all_no_stacktrace(self):
obj = FinalStatus()
obj.engine = EngineEmul()
obj.parameters = BetterDict.from_dict({"report-tests": "all", "print-stacktrace": False})
self.sniff_log(obj.log)
obj.prepare()
obj.startup()
obj.shutdown()
obj.aggregated_results(*self.__get_func_tree())
obj.post_process()
info_log = self.log_recorder.info_buff.getvalue()
self.assertIn("Total: 3 tests", info_log)
self.assertIn("Test TestClass.case1 - PASSED", info_log)
self.assertIn("Test TestClass.case2 - FAILED", info_log)
self.assertIn("Test TestClass.case3 - BROKEN", info_log)
self.assertNotIn("stacktrace2", info_log)
self.assertNotIn("stacktrace3", info_log)
示例5: test_func_report
# 需要导入模块: from bzt.modules.reporting import FinalStatus [as 别名]
# 或者: from bzt.modules.reporting.FinalStatus import prepare [as 别名]
def test_func_report(self):
obj = FinalStatus()
obj.engine = EngineEmul()
obj.parameters = BetterDict()
self.sniff_log(obj.log)
obj.prepare()
obj.startup()
obj.shutdown()
obj.aggregated_results(*self.__get_func_tree())
obj.post_process()
info_log = self.log_recorder.info_buff.getvalue()
warn_log = self.log_recorder.warn_buff.getvalue()
self.assertIn("Total: 3 tests", info_log)
self.assertIn("Test TestClass.case2 failed: something broke", warn_log)
self.assertIn("stacktrace2", warn_log)
self.assertIn("Test TestClass.case3 failed: something is badly broken", warn_log)
self.assertIn("stacktrace3", warn_log)