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


Python skunk_classifiers.SkunkClassificationRule類代碼示例

本文整理匯總了Python中socorro.processor.skunk_classifiers.SkunkClassificationRule的典型用法代碼示例。如果您正苦於以下問題:Python SkunkClassificationRule類的具體用法?Python SkunkClassificationRule怎麽用?Python SkunkClassificationRule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: test_action

    def test_action(self):
        rc = DotDict()
        pc = DotDict()
        processor = None

        skunk_rule = SkunkClassificationRule()
        ok_(skunk_rule.action(rc, pc, processor))
開發者ID:JamJar,項目名稱:socorro,代碼行數:7,代碼來源:test_skunk_classifiers.py

示例2: test_stack_contains

    def test_stack_contains(self):
        stack = cannonical_json_dump['threads'][1]['frames']

        skunk_rule = SkunkClassificationRule()
        ok_(
            skunk_rule._stack_contains(
                stack,
                'ha_',
                c_signature_tool,
                cache_normalizations=False
            ),
        )
        ok_(not
            skunk_rule._stack_contains(
                stack,
                'heh_',
                c_signature_tool,
                cache_normalizations=False
            ),
        )
        ok_(not 'normalized' in stack[0])
        ok_(
            skunk_rule._stack_contains(
                stack,
                'ha_ha2',
                c_signature_tool,
            ),
        )
        ok_('normalized' in stack[0])
開發者ID:JisJis,項目名稱:socorro,代碼行數:29,代碼來源:test_skunk_classifiers.py

示例3: test_add_classification_to_processed_crash

    def test_add_classification_to_processed_crash(self):
        rc = DotDict()
        pc = DotDict()
        pc.classifications = DotDict()
        processor = None

        skunk_rule = SkunkClassificationRule()
        skunk_rule._add_classification(
            pc,
            'stupid',
            'extra stuff'
        )
        self.assertTrue('classifications' in pc)
        self.assertTrue('skunk_works' in pc.classifications)
        self.assertEqual(
            'stupid',
            pc.classifications.skunk_works.classification
        )
        self.assertEqual(
            'extra stuff',
            pc.classifications.skunk_works.classification_data
        )
        self.assertEqual(
            '0.0',
            pc.classifications.skunk_works.classification_version
        )
開發者ID:FishingCactus,項目名稱:socorro,代碼行數:26,代碼來源:test_skunk_classifiers.py

示例4: test_stack_contains

    def test_stack_contains(self):
        stack = cannonical_json_dump["threads"][1]["frames"]

        skunk_rule = SkunkClassificationRule()
        ok_(skunk_rule._stack_contains(stack, "ha_", c_signature_tool, cache_normalizations=False))
        ok_(not skunk_rule._stack_contains(stack, "heh_", c_signature_tool, cache_normalizations=False))
        ok_(not "normalized" in stack[0])
        ok_(skunk_rule._stack_contains(stack, "ha_ha2", c_signature_tool))
        ok_("normalized" in stack[0])
開發者ID:JamJar,項目名稱:socorro,代碼行數:9,代碼來源:test_skunk_classifiers.py

示例5: test_add_classification_to_processed_crash

    def test_add_classification_to_processed_crash(self):
        pc = DotDict()
        pc.classifications = DotDict()

        skunk_rule = SkunkClassificationRule()
        skunk_rule._add_classification(pc, "stupid", "extra stuff")
        ok_("classifications" in pc)
        ok_("skunk_works" in pc.classifications)
        eq_("stupid", pc.classifications.skunk_works.classification)
        eq_("extra stuff", pc.classifications.skunk_works.classification_data)
        eq_("0.0", pc.classifications.skunk_works.classification_version)
開發者ID:JamJar,項目名稱:socorro,代碼行數:11,代碼來源:test_skunk_classifiers.py

示例6: test_predicate

    def test_predicate(self):
        rc = DotDict()
        pc = DotDict()
        pc.classifications = DotDict()
        processor = None

        skunk_rule = SkunkClassificationRule()
        ok_(skunk_rule.predicate(rc, pc, processor))

        pc.classifications.skunk_works = DotDict()
        ok_(skunk_rule.predicate(rc, pc, processor))

        pc.classifications.skunk_works.classification = "stupid"
        ok_(not skunk_rule.predicate(rc, pc, processor))
開發者ID:JamJar,項目名稱:socorro,代碼行數:14,代碼來源:test_skunk_classifiers.py

示例7: test_predicate

    def test_predicate(self):
        rc = DotDict()
        pc = DotDict()
        pc.classifications = DotDict()
        processor = None

        skunk_rule = SkunkClassificationRule()
        self.assertTrue(skunk_rule.predicate(rc, pc, processor))

        pc.classifications.skunk_works = DotDict()
        self.assertTrue(skunk_rule.predicate(rc, pc, processor))

        pc.classifications.skunk_works.classification = 'stupid'
        self.assertFalse(skunk_rule.predicate(rc, pc, processor))
開發者ID:FishingCactus,項目名稱:socorro,代碼行數:14,代碼來源:test_skunk_classifiers.py

示例8: test_get_stack

    def test_get_stack(self):
        pc = DotDict()
        pc.process_type = "plugin"
        skunk_rule = SkunkClassificationRule()

        ok_(not skunk_rule._get_stack(pc, "upload_file_minidump_plugin"))

        pc.json_dump = DotDict()
        pc.json_dump.threads = []
        ok_(not skunk_rule._get_stack(pc, "upload_file_minidump_plugin"))

        pc.json_dump.crash_info = DotDict()
        pc.json_dump.crash_info.crashing_thread = 1
        ok_(not skunk_rule._get_stack(pc, "upload_file_minidump_plugin"))

        pc.json_dump = cannonical_json_dump
        eq_(skunk_rule._get_stack(pc, "upload_file_minidump_plugin"), cannonical_json_dump["crashing_thread"]["frames"])
開發者ID:JamJar,項目名稱:socorro,代碼行數:17,代碼來源:test_skunk_classifiers.py

示例9: test_get_stack

    def test_get_stack(self):
        pc = DotDict()
        pc.process_type = 'plugin'
        skunk_rule = SkunkClassificationRule()
        processor = DotDict()

        self.assertFalse(skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'))

        pc.json_dump = DotDict()
        pc.json_dump.threads = []
        self.assertFalse(skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'))

        pc.json_dump.crash_info = DotDict()
        pc.json_dump.crash_info.crashing_thread = 1
        self.assertFalse(skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'))

        pc.json_dump = cannonical_json_dump
        self.assertEqual(
            skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'),
            cannonical_json_dump['crashing_thread']['frames']
        )
開發者ID:FishingCactus,項目名稱:socorro,代碼行數:21,代碼來源:test_skunk_classifiers.py

示例10: test_add_classification_to_processed_crash

    def test_add_classification_to_processed_crash(self):
        pc = DotDict()
        pc.classifications = DotDict()

        skunk_rule = SkunkClassificationRule()
        skunk_rule._add_classification(
            pc,
            'stupid',
            'extra stuff'
        )
        ok_('classifications' in pc)
        ok_('skunk_works' in pc.classifications)
        eq_(
            'stupid',
            pc.classifications.skunk_works.classification
        )
        eq_(
            'extra stuff',
            pc.classifications.skunk_works.classification_data
        )
        eq_(
            '0.0',
            pc.classifications.skunk_works.classification_version
        )
開發者ID:JisJis,項目名稱:socorro,代碼行數:24,代碼來源:test_skunk_classifiers.py

示例11: test_version

 def test_version(self):
     skunk_rule = SkunkClassificationRule()
     eq_(skunk_rule.version(), "0.0")
開發者ID:JamJar,項目名稱:socorro,代碼行數:3,代碼來源:test_skunk_classifiers.py

示例12: test_version

 def test_version(self):
     skunk_rule = SkunkClassificationRule()
     self.assertEqual(skunk_rule.version(), '0.0')
開發者ID:FishingCactus,項目名稱:socorro,代碼行數:3,代碼來源:test_skunk_classifiers.py


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