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


Python DotDict.json_dump方法代码示例

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


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

示例1: test_action_success

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_action_success(self):
        jd = copy.deepcopy(cannonical_json_dump)
        jd['crashing_thread']['frames'][1]['function'] = (
            "F_1152915508___________________________________"
        )
        jd['crashing_thread']['frames'][3]['function'] = (
            "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes"
            "(bool)"
        )

        jd['crashing_thread']['frames'][5]['function'] = (
            "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)"
        )

        pc = DotDict()
        pc.process_type = 'plugin'
        pc.json_dump = jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()
        rd = {}
        rule = UpdateWindowAttributes()
        action_result = rule.action(rc, rd, pc, fake_processor)

        ok_(action_result)
        ok_('classifications' in pc)
        ok_('skunk_works' in pc['classifications'])
开发者ID:adngdb,项目名称:socorro,代码行数:30,代码来源:test_skunk_classifiers.py

示例2: test_action_case_1

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_action_case_1(self):
        """sentinel exsits in stack, but no secondaries"""
        pc = DotDict()
        pc.process_type = 'plugin'
        pijd = copy.deepcopy(cannonical_json_dump)
        pc.json_dump = pijd
        pc.json_dump['crashing_thread']['frames'][2]['function'] = \
            'NtUserSetWindowPos'
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

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

        self.assertTrue(action_result)
        self.assertTrue('classifications' in pc)
        self.assertTrue('skunk_works' in pc.classifications)
        self.assertEqual(
            pc.classifications.skunk_works.classification,
            'NtUserSetWindowPos | other'
        )
开发者ID:FishingCactus,项目名称:socorro,代码行数:28,代码来源:test_skunk_classifiers.py

示例3: test_stuff_missing

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_stuff_missing(self):
        config = self.get_basic_config()

        raw_crash = copy.copy(canonical_standard_raw_crash)

        raw_dumps = {}
        system_info = copy.copy(
            canonical_processed_crash['json_dump']['system_info']
        )
        del system_info['cpu_count']
        processed_crash = DotDict()
        processed_crash.json_dump = {
            'system_info': system_info
        }

        processor_meta = self.get_basic_processor_meta()

        rule = CPUInfoRule(config)

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

        eq_(
            processed_crash.cpu_info,
            "GenuineIntel family 6 model 42 stepping 7"
        )
        eq_(processed_crash.cpu_name, 'x86')

        # raw crash should be unchanged
        eq_(raw_crash, canonical_standard_raw_crash)
开发者ID:FrostburnStudios,项目名称:socorro,代码行数:32,代码来源:test_general_transform_rules.py

示例4: _execute_external_process

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def _execute_external_process(self, command_line, processor_meta):
        stackwalker_output, return_code = super(BreakpadStackwalkerRule2015, self)._execute_external_process(
            command_line, processor_meta
        )

        if not isinstance(stackwalker_output, Mapping):
            processor_meta.processor_notes.append(
                "MDSW produced unexpected output: %s..." % str(stackwalker_output)[:10]
            )
            stackwalker_output = {}

        stackwalker_data = DotDict()
        stackwalker_data.json_dump = stackwalker_output
        stackwalker_data.mdsw_return_code = return_code

        stackwalker_data.mdsw_status_string = stackwalker_output.get("status", "unknown error")
        stackwalker_data.success = stackwalker_data.mdsw_status_string == "OK"

        if return_code == 124:
            processor_meta.processor_notes.append("MDSW terminated with SIGKILL due to timeout")
        elif return_code != 0 or not stackwalker_data.success:
            processor_meta.processor_notes.append(
                "MDSW failed on '%s': %s" % (command_line, stackwalker_data.mdsw_status_string)
            )

        return stackwalker_data, return_code
开发者ID:rhelmer,项目名称:socorro,代码行数:28,代码来源:breakpad_transform_rules.py

示例5: test_predicate

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_predicate(self):
        jd = copy.deepcopy(cannonical_json_dump)
        processed_crash = DotDict()
        processed_crash.json_dump = jd
        raw_crash = DotDict()
        raw_crash.ProductName = 'Firefox'
        raw_crash.Version = '16'

        fake_processor = create_basic_fake_processor()
        fake_processor.config.firefox_out_of_date_version = '17'

        classifier = OutOfDateClassifier()
        self.assertTrue(classifier._predicate(
            raw_crash,
            processed_crash,
            fake_processor
        ))

        raw_crash.Version = '19'
        self.assertFalse(classifier._predicate(
            raw_crash,
            processed_crash,
            fake_processor
        ))

        raw_crash.Version = '12'
        raw_crash.ProductName = 'NotFireFox'
        self.assertFalse(classifier._predicate(
            raw_crash,
            processed_crash,
            fake_processor
        ))
开发者ID:FishingCactus,项目名称:socorro,代码行数:34,代码来源:test_support_classifiers.py

示例6: test_action_case_2

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_action_case_2(self):
        """sentinel exsits in stack, plus one secondary"""
        pc = DotDict()
        pc.process_type = 'plugin'
        pijd = copy.deepcopy(cannonical_json_dump)
        pc.json_dump = pijd
        pc.json_dump['crashing_thread']['frames'][2]['function'] = \
            'NtUserSetWindowPos'
        pc.json_dump['crashing_thread']['frames'][4]['function'] = \
            'F_1378698112'
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

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

        ok_(action_result)
        ok_('classifications' in pc)
        ok_('skunk_works' in pc.classifications)
        eq_(
            pc.classifications.skunk_works.classification,
            'NtUserSetWindowPos | F_1378698112'
        )
开发者ID:JisJis,项目名称:socorro,代码行数:30,代码来源:test_skunk_classifiers.py

示例7: test_get_stack

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

示例8: test_windows_action

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_windows_action(self):
        jd = copy.deepcopy(cannonical_json_dump)
        processed_crash = DotDict()
        processed_crash.json_dump = jd
        raw_crash = DotDict()
        raw_crash.ProductName = 'Firefox'
        raw_crash.Version = '16'
        raw_dumps = {}

        fake_processor = create_basic_fake_processor()

        classifier = OutOfDateClassifier()
        classifier.out_of_date_threshold = ('17',)
        processed_crash.json_dump['system_info']['os'] = 'Windows NT'
        processed_crash.json_dump['system_info']['os_ver'] = \
            '5.1.2600 Service Pack 2'
        ok_(classifier._windows_action(
            raw_crash,
            raw_dumps,
            processed_crash,
            fake_processor
        ))
        eq_(
            processed_crash.classifications.support.classification,
            'firefox-no-longer-works-some-versions-windows-xp'
        )

        classifier = OutOfDateClassifier()
        classifier.out_of_date_threshold = ('17',)
        processed_crash.json_dump['system_info']['os'] = 'Windows NT'
        processed_crash.json_dump['system_info']['os_ver'] = \
            '5.0 Service Pack 23'
        ok_(classifier._windows_action(
            raw_crash,
            raw_dumps,
            processed_crash,
            fake_processor
        ))
        eq_(
            processed_crash.classifications.support.classification,
            'firefox-no-longer-works-windows-2000'
        )

        classifier = OutOfDateClassifier()
        classifier.out_of_date_threshold = ('17',)
        processed_crash.json_dump['system_info']['os'] = 'Windows NT'
        processed_crash.json_dump['system_info']['os_ver'] = \
            '5.1.2600 Service Pack 3'
        ok_(classifier._windows_action(
            raw_crash,
            raw_dumps,
            processed_crash,
            fake_processor
        ))
        eq_(
            processed_crash.classifications.support.classification,
            'update-firefox-latest-version'
        )
开发者ID:FrostburnStudios,项目名称:socorro,代码行数:60,代码来源:test_support_classifiers.py

示例9: test_get_stack

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

示例10: test_action_fail

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_action_fail(self):
        jd = copy.deepcopy(cannonical_json_dump)
        pc = DotDict()
        pc.json_dump = jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

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

        self.assertFalse(action_result)
        self.assertTrue('classifications' not in pc)
开发者ID:esamanas,项目名称:socorro,代码行数:16,代码来源:test_support_classifiers.py

示例11: test_action_fail

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_action_fail(self):
        jd = copy.deepcopy(cannonical_json_dump)
        pc = DotDict()
        pc.json_dump = jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()
        rd = {}
        rule = BitguardClassifier()
        action_result = rule.action(rc, rd, pc, fake_processor)

        ok_(not action_result)
        ok_('classifications' not in pc)
开发者ID:FrostburnStudios,项目名称:socorro,代码行数:16,代码来源:test_support_classifiers.py

示例12: test_everything_we_hoped_for

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_everything_we_hoped_for(self):
        config = self.get_basic_config()

        raw_crash = copy.copy(canonical_standard_raw_crash)
        raw_dumps = {}
        processed_crash = DotDict()
        processed_crash.json_dump = copy.copy(cannonical_stackwalker_output)
        processor_meta = self.get_basic_processor_meta()

        rule = CrashingThreadRule(config)

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

        eq_(processed_crash.crashedThread, 0)
开发者ID:Tchanders,项目名称:socorro,代码行数:17,代码来源:test_breakpad_transform_rules.py

示例13: test_stuff_missing

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_stuff_missing(self):
        config = self.get_basic_config()

        raw_crash = copy.copy(canonical_standard_raw_crash)
        raw_dumps = {}
        processed_crash = DotDict()
        processed_crash.json_dump = {}
        processor_meta = self.get_basic_processor_meta()

        rule = CrashingThreadRule(config)

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

        assert processed_crash.crashedThread is None
        assert processor_meta.processor_notes == ['MDSW did not identify the crashing thread']
开发者ID:stephendonner,项目名称:socorro,代码行数:18,代码来源:test_breakpad_transform_rules.py

示例14: test_action_success

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_action_success(self):
        jd = copy.deepcopy(cannonical_json_dump)
        jd['modules'].append({'filename': 'bitguard.dll'})
        pc = DotDict()
        pc.json_dump = jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

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

        self.assertTrue(action_result)
        self.assertTrue('classifications' in pc)
        self.assertTrue('support' in pc.classifications)
        self.assertEqual(
            'bitguard',
            pc.classifications.support.classification
        )
开发者ID:esamanas,项目名称:socorro,代码行数:22,代码来源:test_support_classifiers.py

示例15: test_action_case_1

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import json_dump [as 别名]
    def test_action_case_1(self):
        """sentinel exsits in stack, but no secondaries"""
        pc = DotDict()
        pc.process_type = "plugin"
        pijd = copy.deepcopy(cannonical_json_dump)
        pc.json_dump = pijd
        pc.json_dump["crashing_thread"]["frames"][2]["function"] = "NtUserSetWindowPos"
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

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

        ok_(action_result)
        ok_("classifications" in pc)
        ok_("skunk_works" in pc.classifications)
        eq_(pc.classifications.skunk_works.classification, "NtUserSetWindowPos | other")
开发者ID:JamJar,项目名称:socorro,代码行数:24,代码来源:test_skunk_classifiers.py


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