当前位置: 首页>>代码示例>>Python>>正文


Python breakpad_transform_rules.JitCrashCategorizeRule类代码示例

本文整理汇总了Python中socorro.processor.breakpad_transform_rules.JitCrashCategorizeRule的典型用法代码示例。如果您正苦于以下问题:Python JitCrashCategorizeRule类的具体用法?Python JitCrashCategorizeRule怎么用?Python JitCrashCategorizeRule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JitCrashCategorizeRule类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_subprocess_fail

    def test_subprocess_fail(self, mocked_subprocess_module):
        config = self.get_basic_config()
        raw_crash = copy.copy(canonical_standard_raw_crash)
        raw_dumps = {config.dump_field: 'a_fake_dump.dump'}
        processed_crash = CDotDict()
        processed_crash.product = 'Firefox'
        processed_crash.os_name = 'Windows 386'
        processed_crash.cpu_name = 'x86'
        processed_crash.signature = 'EnterBaseline'
        processed_crash['json_dump.crashing_thread.frames'] = [
            DotDict({'not_module': 'not-a-module',}),
            DotDict({'module': 'a-module',})
        ]
        processor_meta = self.get_basic_processor_meta()

        mocked_subprocess_handle = (
            mocked_subprocess_module.Popen.return_value
        )
        mocked_subprocess_handle.stdout.read.return_value = (
            None
        )
        mocked_subprocess_handle.wait.return_value = -1

        rule = JitCrashCategorizeRule(config)

        # the call to be tested
        rule.act(raw_crash, raw_dumps, processed_crash, processor_meta)

        eq_(processor_meta.processor_notes, [])
        ok_(processed_crash.classifications.jit.category is None)
        eq_(processed_crash.classifications.jit.category_return_code, -1)
开发者ID:4thAce,项目名称:socorro,代码行数:31,代码来源:test_breakpad_transform_rules.py

示例2: test_wrong_signature

    def test_wrong_signature(self, mocked_subprocess_module):
        config = self.get_basic_config()
        raw_crash = copy.copy(canonical_standard_raw_crash)
        raw_dumps = {config.dump_field: 'a_fake_dump.dump'}
        processed_crash = DotDict()
        processed_crash.product = 'Firefox'
        processed_crash.os_name = 'Windows NT'
        processed_crash.cpu_name = 'x86'
        processed_crash.signature = 'this-is-not-a-JIT-signature'
        processed_crash['json_dump.crashing_thread.frames'] = [
            DotDict({'not_module': 'not-a-module',}),
            DotDict({'module': 'a-module',})
        ]
        processor_meta = self.get_basic_processor_meta()

        mocked_subprocess_handle = (
            mocked_subprocess_module.Popen.return_value
        )
        mocked_subprocess_handle.stdout.read.return_value = (
            'EXTRA-SPECIAL'
        )
        mocked_subprocess_handle.wait.return_value = 0

        rule = JitCrashCategorizeRule(config)

        # the call to be tested
        rule.act(raw_crash, raw_dumps, processed_crash, processor_meta)

        ok_('classifications.jit.category' not in processed_crash)
        ok_('classifications.jit.category_return_code' not in processed_crash)
开发者ID:4thAce,项目名称:socorro,代码行数:30,代码来源:test_breakpad_transform_rules.py

示例3: test_everything_we_hoped_for

    def test_everything_we_hoped_for(self, mocked_subprocess_module):
        config = self.get_basic_config()
        raw_crash = copy.copy(canonical_standard_raw_crash)
        raw_dumps = {config.dump_field: 'a_fake_dump.dump'}
        processed_crash = DotDict()
        processed_crash.product = 'Firefox'
        processed_crash.os_name = 'Windows 386'
        processed_crash.cpu_name = 'x86'
        processed_crash.signature = 'EnterBaseline'
        processed_crash['json_dump.crashing_thread.frames'] = [
            DotDict({'not_module': 'not-a-module'}),
            DotDict({'module': 'a-module'})
        ]
        processor_meta = get_basic_processor_meta()

        mocked_subprocess_handle = mocked_subprocess_module.Popen.return_value
        mocked_subprocess_handle.stdout.read.return_value = 'EXTRA-SPECIAL'
        mocked_subprocess_handle.wait.return_value = 0

        rule = JitCrashCategorizeRule(config)
        rule.act(raw_crash, raw_dumps, processed_crash, processor_meta)

        assert processor_meta.processor_notes == []
        assert processed_crash.classifications.jit.category == 'EXTRA-SPECIAL'
        assert processed_crash.classifications.jit.category_return_code == 0
开发者ID:mozilla,项目名称:socorro,代码行数:25,代码来源:test_breakpad_transform_rules.py

示例4: test_no_crashing_thread

    def test_no_crashing_thread(self, mocked_subprocess_module):
        config = self.get_basic_config()
        raw_crash = copy.copy(canonical_standard_raw_crash)
        raw_dumps = {config.dump_field: 'a_fake_dump.dump'}
        processed_crash = DotDict()
        processed_crash.product = 'Firefox'
        processed_crash.os_name = 'Windows NT'
        processed_crash.cpu_name = 'x86'
        processed_crash.signature = 'EnterBaseline'
        processed_crash['json_dump'] = {}  # note the empty json_dump
        processor_meta = self.get_basic_processor_meta()

        mocked_subprocess_handle = (
            mocked_subprocess_module.Popen.return_value
        )
        mocked_subprocess_handle.stdout.read.return_value = (
            'EXTRA-SPECIAL'
        )
        mocked_subprocess_handle.wait.return_value = 0

        rule = JitCrashCategorizeRule(config)

        # the call to be tested
        res = rule._predicate(
            raw_crash, raw_dumps, processed_crash, processor_meta
        )

        # Simply verify that no exception is raised.
        ok_(res)
开发者ID:Krispy2009,项目名称:socorro,代码行数:29,代码来源:test_breakpad_transform_rules.py

示例5: test_predicate_no_json_dump

    def test_predicate_no_json_dump(self):
        config = self.get_basic_config()
        processed_crash = DotDict({
            'product': 'Firefox',
            'os_name': 'Windows NT',
            'cpu_name': 'x86',
            'signature': 'EnterBaseline',
        })

        rule = JitCrashCategorizeRule(config)
        assert rule.predicate({}, {}, processed_crash, {}) is True
开发者ID:mozilla,项目名称:socorro,代码行数:11,代码来源:test_breakpad_transform_rules.py

示例6: test_predicate_empty_frames

    def test_predicate_empty_frames(self):
        config = self.get_basic_config()
        processed_crash = DotDict({
            'product': 'Firefox',
            'os_name': 'Windows NT',
            'cpu_name': 'x86',
            'signature': 'EnterBaseline',

            'json_dump': {
                'crashing_thread': {
                    # There is a "frames" key, but nothing in the list
                    'frames': []
                }
            },
        })

        rule = JitCrashCategorizeRule(config)
        assert rule.predicate({}, {}, processed_crash, {}) is True
开发者ID:mozilla,项目名称:socorro,代码行数:18,代码来源:test_breakpad_transform_rules.py

示例7: test_success_all_types_of_signatures

    def test_success_all_types_of_signatures(self, mocked_subprocess_module):
        config = self.get_basic_config()
        raw_crash = copy.copy(canonical_standard_raw_crash)
        raw_dumps = {config.dump_field: 'a_fake_dump.dump'}
        base_processed_crash = CDotDict()
        base_processed_crash.product = 'Firefox'
        base_processed_crash.os_name = 'Windows 386'
        base_processed_crash.cpu_name = 'x86'
        base_processed_crash['json_dump.crashing_thread.frames'] = [
            DotDict({'not_module': 'not-a-module'}),
            DotDict({'module': 'a-module'})
        ]
        processor_meta = self.get_basic_processor_meta()

        mocked_subprocess_handle = (
            mocked_subprocess_module.Popen.return_value
        )
        mocked_subprocess_handle.stdout.read.return_value = (
            'EXTRA-SPECIAL'
        )
        mocked_subprocess_handle.wait.return_value = 0

        rule = JitCrashCategorizeRule(config)

        signatures = [
            'EnterBaseline',
            'moz::something | EnterBaseline',
            'EnterIon',
            'js::jit::FastInvoke',
            'Foo::Bar__js::jit::IonCannon',
            'Small | js::irregexp::ExecuteCode<T>',
        ]
        for signature in signatures:
            processed_crash = CDotDict(base_processed_crash)
            processed_crash.signature = signature

            # the call to be tested
            rule.act(raw_crash, raw_dumps, processed_crash, processor_meta)

            eq_(processor_meta.processor_notes, [])
            eq_(processed_crash.classifications.jit.category, 'EXTRA-SPECIAL')
            eq_(processed_crash.classifications.jit.category_return_code, 0)
开发者ID:nnethercote,项目名称:socorro,代码行数:42,代码来源:test_breakpad_transform_rules.py


注:本文中的socorro.processor.breakpad_transform_rules.JitCrashCategorizeRule类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。