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


Python DotDict.signature方法代码示例

本文整理汇总了Python中socorro.lib.util.DotDict.signature方法的典型用法代码示例。如果您正苦于以下问题:Python DotDict.signature方法的具体用法?Python DotDict.signature怎么用?Python DotDict.signature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在socorro.lib.util.DotDict的用法示例。


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

示例1: test_wrong_signature

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
    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:Tchanders,项目名称:socorro,代码行数:32,代码来源:test_breakpad_transform_rules.py

示例2: test_no_crashing_thread

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
    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,代码行数:31,代码来源:test_breakpad_transform_rules.py

示例3: test_OOMAllocationSize_predicate_signature_fragment_3

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_OOMAllocationSize_predicate_signature_fragment_3(self):
     pc = DotDict()
     pc.signature = 'CrashAtUnhandlableOOM'
     rc = DotDict()
     fake_processor = create_basic_fake_processor()
     rule = OOMSignature()
     predicate_result = rule.predicate(rc, pc, fake_processor)
     ok_(predicate_result)
开发者ID:Earth4,项目名称:socorro,代码行数:10,代码来源:test_processed_transform_rules.py

示例4: test_OOMAllocationSize_predicate_signature_fragment_2

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_OOMAllocationSize_predicate_signature_fragment_2(self):
     pc = DotDict()
     pc.signature = 'mozalloc_handle_oom | this | is | bad'
     rc = DotDict()
     fake_processor = create_basic_fake_processor()
     rule = OOMSignature()
     predicate_result = rule.predicate(rc, pc, fake_processor)
     ok_(predicate_result)
开发者ID:Earth4,项目名称:socorro,代码行数:10,代码来源:test_processed_transform_rules.py

示例5: test_OOMAllocationSize_predicate_signature_fragment_1

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_OOMAllocationSize_predicate_signature_fragment_1(self):
     pc = DotDict()
     pc.signature = 'this | is | a | NS_ABORT_OOM | signature'
     rc = DotDict()
     fake_processor = create_basic_fake_processor()
     rule = OOMSignature()
     predicate_result = rule.predicate(rc, pc, fake_processor)
     ok_(predicate_result)
开发者ID:Earth4,项目名称:socorro,代码行数:10,代码来源:test_processed_transform_rules.py

示例6: test_OOMAllocationSize_predicate_no_match

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_OOMAllocationSize_predicate_no_match(self):
     pc = DotDict()
     pc.signature = 'hello'
     rc = DotDict()
     fake_processor = create_basic_fake_processor()
     rule = OOMSignature()
     predicate_result = rule.predicate(rc, pc, fake_processor)
     ok_(not predicate_result)
开发者ID:Earth4,项目名称:socorro,代码行数:10,代码来源:test_processed_transform_rules.py

示例7: test_SigTrunc_predicate

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_SigTrunc_predicate(self):
     pc = DotDict()
     pc.signature = '9' * 256
     rc = DotDict()
     fake_processor = create_basic_fake_processor()
     rule = SigTrunc()
     predicate_result = rule.predicate(rc, pc, fake_processor)
     ok_(predicate_result)
开发者ID:Earth4,项目名称:socorro,代码行数:10,代码来源:test_processed_transform_rules.py

示例8: test_SigTrunc_predicate_no_match

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_SigTrunc_predicate_no_match(self):
     pc = DotDict()
     pc.signature = '0' * 100
     rc = DotDict()
     fake_processor = create_basic_fake_processor()
     rule = SigTrunc()
     predicate_result = rule.predicate(rc, pc, fake_processor)
     ok_(not predicate_result)
开发者ID:Earth4,项目名称:socorro,代码行数:10,代码来源:test_processed_transform_rules.py

示例9: test_SigTrunc_action_success

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_SigTrunc_action_success(self):
     pc = DotDict()
     pc.signature = '9' * 256
     rc = DotDict()
     fake_processor = create_basic_fake_processor()
     rule = SigTrunc()
     predicate_result = rule.action(rc, pc, fake_processor)
     ok_(predicate_result)
     eq_(len(pc.signature), 255)
     ok_(pc.signature.endswith('9...'))
开发者ID:Earth4,项目名称:socorro,代码行数:12,代码来源:test_processed_transform_rules.py

示例10: test_OOMAllocationSize_predicate

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
 def test_OOMAllocationSize_predicate(self):
     pc = DotDict()
     pc.signature = 'hello'
     rd = {}
     rc = DotDict()
     rc.OOMAllocationSize = 17
     fake_processor = create_basic_fake_processor()
     rule = OOMSignature(fake_processor.config)
     predicate_result = rule.predicate(rc, rd, pc, fake_processor)
     ok_(predicate_result)
开发者ID:jberkus,项目名称:socorro,代码行数:12,代码来源:test_processed_transform_rules.py

示例11: test_OOMAllocationSize_action_success

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
    def test_OOMAllocationSize_action_success(self):
        pc = DotDict()
        pc.signature = 'hello'

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

        rule = OOMSignature()
        action_result = rule.action(rc, pc, fake_processor)

        ok_(action_result)
        ok_(pc.original_signature, 'hello')
        ok_(pc.signature, 'OOM | unknown | hello')
开发者ID:Earth4,项目名称:socorro,代码行数:16,代码来源:test_processed_transform_rules.py

示例12: test_action_large

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
    def test_action_large(self):
        pc = DotDict()
        pc.signature = 'hello'

        fake_processor = create_basic_fake_processor()

        rc = DotDict()
        rc.OOMAllocationSize = 17000000

        rule = OOMSignature()
        action_result = rule.action(rc, pc, fake_processor)

        ok_(action_result)
        ok_(pc.original_signature, 'hello')
        ok_(pc.signature, 'OOM | large | hello')
开发者ID:abracadaber,项目名称:socorro,代码行数:17,代码来源:test_processed_transform_rules.py

示例13: test_OOMAllocationSize_action_small

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
    def test_OOMAllocationSize_action_small(self):
        pc = DotDict()
        pc.signature = 'hello'

        fake_processor = create_basic_fake_processor()

        rc = DotDict()
        rc.OOMAllocationSize = 17
        rd = {}

        rule = OOMSignature(fake_processor.config)
        action_result = rule.action(rc, rd, pc, fake_processor)

        ok_(action_result)
        ok_(pc.original_signature, 'hello')
        ok_(pc.signature, 'OOM | small')
开发者ID:jberkus,项目名称:socorro,代码行数:18,代码来源:test_processed_transform_rules.py

示例14: convert_raw_crash_to_processed_crash

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import signature [as 别名]
    def convert_raw_crash_to_processed_crash(self, raw_crash, raw_dumps):
        """Take a raw_crash and its associated raw_dumps and return a
        processed_crash.
        """
        # processor_meta_data will be used to ferry "inside information" to
        # transformation rules.  Sometimes rules need a bit more extra
        # information about the transformation process itself.
        processor_meta_data = DotDict()
        processor_meta_data.processor_notes = [
            self.config.processor_name,
            self.__class__.__name__
        ]
        processor_meta_data.quit_check = self.quit_check
        processor_meta_data.processor = self

        # create the empty processed crash
        processed_crash = DotDict()
        processed_crash.success = False
        processed_crash.started_datetime = utc_now()
        # for backwards compatibility:
        processed_crash.startedDateTime = processed_crash.started_datetime
        processed_crash.signature = 'EMPTY: crash failed to process'

        crash_id = raw_crash.get('uuid', 'unknown')
        try:
            # quit_check calls ought to be scattered around the code to allow
            # the processor to be responsive to requests to shut down.
            self.quit_check()

            processor_meta_data.started_timestamp = self._log_job_start(
                crash_id
            )

            # apply transformations
            #    step through each of the rule sets to apply the rules.
            for a_rule_set in self.rule_system:
                # for each rule set, invoke the 'act' method - this method
                # will be the method specified in fourth element of the
                # rule set configuration list.
                a_rule_set.act(
                    raw_crash,
                    raw_dumps,
                    processed_crash,
                    processor_meta_data
                )
                self.quit_check()

            # the crash made it through the processor rules with no exceptions
            # raised, call it a success.
            processed_crash.success = True

        except Exception, x:
            self.config.logger.warning(
                'Error while processing %s: %s',
                crash_id,
                str(x),
                exc_info=True
            )
            processor_meta_data.processor_notes.append(
                'unrecoverable processor error: %s' % x
            )
开发者ID:jberkus,项目名称:socorro,代码行数:63,代码来源:processor_2015.py


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