本文整理匯總了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)