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


Python PassFailStatus.shutdown方法代碼示例

本文整理匯總了Python中bzt.modules.passfail.PassFailStatus.shutdown方法的典型用法代碼示例。如果您正苦於以下問題:Python PassFailStatus.shutdown方法的具體用法?Python PassFailStatus.shutdown怎麽用?Python PassFailStatus.shutdown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bzt.modules.passfail.PassFailStatus的用法示例。


在下文中一共展示了PassFailStatus.shutdown方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_ashort_data

# 需要導入模塊: from bzt.modules.passfail import PassFailStatus [as 別名]
# 或者: from bzt.modules.passfail.PassFailStatus import shutdown [as 別名]
    def test_ashort_data(self):
        obj = PassFailStatus()
        obj.engine = EngineEmul()

        crit_cfg = DataCriterion.string_to_config("failures>0%, stop as failed")
        obj.criteria.append(DataCriterion(crit_cfg, obj))

        point = DataPoint(0)
        point[DataPoint.CUMULATIVE] = {}
        point[DataPoint.CUMULATIVE][''] = {}
        point[DataPoint.CUMULATIVE][''][KPISet.FAILURES] = 100 * 16
        point[DataPoint.CUMULATIVE][''][KPISet.SAMPLE_COUNT] = 100 * 16

        obj.check()
        obj.shutdown()
        obj.aggregated_second(point)
        self.assertRaises(AutomatedShutdown, obj.post_process)
開發者ID:PurdyForks,項目名稱:taurus,代碼行數:19,代碼來源:test_passFailStatus.py

示例2: test_percentiles_track

# 需要導入模塊: from bzt.modules.passfail import PassFailStatus [as 別名]
# 或者: from bzt.modules.passfail.PassFailStatus import shutdown [as 別名]
    def test_percentiles_track(self):
        obj = PassFailStatus()
        obj.engine = EngineEmul()
        obj.parameters = {"criteria": ["p90>0ms"]}
        obj.prepare()
        self.assertGreater(len(obj.criteria), 0)

        for n in range(0, 10):
            point = random_datapoint(n)
            obj.aggregated_second(point)
            obj.check()

        obj.shutdown()
        try:
            obj.post_process()
            self.fail()
        except AutomatedShutdown:
            pass
開發者ID:PurdyForks,項目名稱:taurus,代碼行數:20,代碼來源:test_passFailStatus.py

示例3: test_cumulative_criteria_post_process

# 需要導入模塊: from bzt.modules.passfail import PassFailStatus [as 別名]
# 或者: from bzt.modules.passfail.PassFailStatus import shutdown [as 別名]
    def test_cumulative_criteria_post_process(self):
        obj = PassFailStatus()
        obj.engine = EngineEmul()
        obj.parameters = {"criteria": [
            "p90>0ms, continue as failed",
            "avg-rt>0ms, continue as failed",
        ]}
        obj.prepare()
        self.assertEquals(len(obj.criteria), 2)

        for n in range(0, 10):
            point = random_datapoint(n)
            obj.aggregated_second(point)
            obj.check()

        obj.shutdown()
        self.assertRaises(AutomatedShutdown, obj.post_process)
        for crit in obj.criteria:
            self.assertTrue(crit.is_triggered)
開發者ID:PurdyForks,項目名稱:taurus,代碼行數:21,代碼來源:test_passFailStatus.py

示例4: test_prepare_label_issue

# 需要導入模塊: from bzt.modules.passfail import PassFailStatus [as 別名]
# 或者: from bzt.modules.passfail.PassFailStatus import shutdown [as 別名]
    def test_prepare_label_issue(self):
        # https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/codename-taurus/PWjU7xVucZ0/WkjUAbE1EwAJ
        obj = PassFailStatus()
        obj.parameters = {"criterias": ["avg-rt of spaced label>10ms"]}
        obj.prepare()
        self.assertGreater(len(obj.criterias), 0)

        for n in range(0, 10):
            point = random_datapoint(n)
            point[DataPoint.CUMULATIVE]['spaced label'] = point[DataPoint.CUMULATIVE]['']
            point[DataPoint.CURRENT]['spaced label'] = point[DataPoint.CURRENT]['']
            obj.aggregated_second(point)
            obj.check()

        obj.shutdown()

        try:
            obj.post_process()
            self.fail()
        except AutomatedShutdown:
            pass
開發者ID:kobi1023,項目名稱:taurus,代碼行數:23,代碼來源:test_passFailStatus.py

示例5: TestPassFailStatus

# 需要導入模塊: from bzt.modules.passfail import PassFailStatus [as 別名]
# 或者: from bzt.modules.passfail.PassFailStatus import shutdown [as 別名]

#.........這裏部分代碼省略.........
                "avg-rt>100ms within 10s",
            ]})
        self.obj.prepare()

        start_time = time.time()
        for _n in range(0, 20):
            point = random_datapoint(start_time)
            self.obj.aggregated_second(point)
            if _n % 2 == 0:
                try:
                    self.obj.check()
                except KeyboardInterrupt:
                    pass

            try:
                self.obj.check()
            except KeyboardInterrupt:
                pass
            start_time += 1

    def test_prepare_label_issue(self):
        # https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/codename-taurus/PWjU7xVucZ0/WkjUAbE1EwAJ
        self.configure({"criteria": ["avg-rt of spaced label>10ms"]})
        self.obj.prepare()
        self.assertGreater(len(self.obj.criteria), 0)

        for n in range(0, 10):
            point = random_datapoint(n)
            point[DataPoint.CUMULATIVE]['spaced label'] = point[DataPoint.CUMULATIVE]['']
            point[DataPoint.CURRENT]['spaced label'] = point[DataPoint.CURRENT]['']
            self.obj.aggregated_second(point)
            self.obj.check()

        self.obj.shutdown()

        try:
            self.obj.post_process()
            self.fail()
        except AutomatedShutdown:
            pass

    def test_named_criteria(self):
        self.configure({"criteria": {"named criterion": "avg-rt of spaced label>10ms"}})
        self.obj.prepare()
        self.assertGreater(len(self.obj.criteria), 0)
        self.assertEquals(self.obj.criteria[0].message, "named criterion")

    def test_stop_counting_criteria(self):
        self.configure({"criteria": ["avg-rt>10ms for 2s, continue as failed"]})
        self.obj.prepare()
        self.obj.get_widget()
        start_time = time.time()

        for _n in range(0, 10):
            point = random_datapoint(start_time)
            point[DataPoint.CURRENT]['']["avg_rt"] = 1.0
            self.obj.aggregated_second(point)
            self.obj.check()
            start_time += 1

        self.assertEqual(self.obj.widget.text_widget.text, "Failed: avg-rt>10ms for 10 sec\n")

        for _n in range(0, 10):
            point = random_datapoint(start_time)
            point[DataPoint.CURRENT]['']["avg_rt"] = 0.01
            self.obj.aggregated_second(point)
開發者ID:keithmork,項目名稱:taurus,代碼行數:70,代碼來源:test_passFailStatus.py


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