當前位置: 首頁>>代碼示例>>Python>>正文


Python FinalStatus.prepare方法代碼示例

本文整理匯總了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())
開發者ID:kobi1023,項目名稱:taurus,代碼行數:14,代碼來源:test_FinalStatsReporter.py

示例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)
開發者ID:itaymendel,項目名稱:taurus,代碼行數:16,代碼來源:test_FinalStatusReporter.py

示例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())
開發者ID:andy7i,項目名稱:taurus,代碼行數:17,代碼來源:test_FinalStatusReporter.py

示例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)
開發者ID:andy7i,項目名稱:taurus,代碼行數:19,代碼來源:test_FinalStatusReporter.py

示例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)
開發者ID:andy7i,項目名稱:taurus,代碼行數:19,代碼來源:test_FinalStatusReporter.py


注:本文中的bzt.modules.reporting.FinalStatus.prepare方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。