本文整理汇总了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))
示例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])
示例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
)
示例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])
示例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)
示例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))
示例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))
示例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"])
示例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']
)
示例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
)
示例11: test_version
def test_version(self):
skunk_rule = SkunkClassificationRule()
eq_(skunk_rule.version(), "0.0")
示例12: test_version
def test_version(self):
skunk_rule = SkunkClassificationRule()
self.assertEqual(skunk_rule.version(), '0.0')