def test_action_failure(self): """success - target signature not found""" pc = DotDict() f2jd = copy.deepcopy(cannonical_json_dump) pc.upload_file_minidump_flash2 = DotDict() pc.upload_file_minidump_flash2.json_dump = f2jd pc.upload_file_minidump_flash2.signature = 'lars was here' fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = Bug811804() action_result = rule.action(rc, rd, pc, fake_processor) ok_(not action_result) ok_(not 'classifications' in pc)
def test_action_success(self): """success - target signature fonud""" pc = DotDict() f2jd = copy.deepcopy(cannonical_json_dump) pc.upload_file_minidump_flash2 = DotDict() pc.upload_file_minidump_flash2.json_dump = f2jd pc.upload_file_minidump_flash2.signature = \ 'hang | NtUserWaitMessage | F34033164' \ '________________________________' fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = Bug811804() action_result = rule.action(rc, rd, pc, fake_processor) ok_(action_result) ok_('classifications' in pc) eq_(pc.classifications.skunk_works.classification, 'bug811804-NtUserWaitMessage')