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


Python ESCrashStorage.close方法代码示例

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


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

示例1: test_index_crash_with_bad_keys

# 需要导入模块: from socorro.external.es.crashstorage import ESCrashStorage [as 别名]
# 或者: from socorro.external.es.crashstorage.ESCrashStorage import close [as 别名]
    def test_index_crash_with_bad_keys(self):
        a_raw_crash_with_bad_keys = {
            'foo': 'alpha',
            '': 'bad key 1',
            '.': 'bad key 2',
            u'na\xefve': 'bad key 3',
        }

        es_storage = ESCrashStorage(config=self.config)

        es_storage.save_raw_and_processed(
            raw_crash=deepcopy(a_raw_crash_with_bad_keys),
            dumps=None,
            processed_crash=deepcopy(a_processed_crash),
            crash_id=a_processed_crash['uuid']
        )

        # Ensure that the document was indexed by attempting to retreive it.
        doc = self.es_client.get(
            index=self.config.elasticsearch.elasticsearch_index,
            id=a_processed_crash['uuid']
        )
        # Make sure the invalid keys aren't in the crash.
        raw_crash = doc['_source']['raw_crash']
        assert raw_crash == {'foo': 'alpha'}
        es_storage.close()
开发者ID:willkg,项目名称:socorro,代码行数:28,代码来源:test_crashstorage.py

示例2: test_index_crash

# 需要导入模块: from socorro.external.es.crashstorage import ESCrashStorage [as 别名]
# 或者: from socorro.external.es.crashstorage.ESCrashStorage import close [as 别名]
    def test_index_crash(self):
        """Test indexing a crash document."""
        es_storage = ESCrashStorage(config=self.config)

        es_storage.save_raw_and_processed(
            raw_crash=deepcopy(a_raw_crash),
            dumps=None,
            processed_crash=deepcopy(a_processed_crash),
            crash_id=a_processed_crash['uuid']
        )

        # Ensure that the document was indexed by attempting to retreive it.
        assert (
            self.es_client.get(
                index=es_storage.es_context.get_index_template(),
                id=a_processed_crash['uuid']
            )
        )
        es_storage.close()
开发者ID:willkg,项目名称:socorro,代码行数:21,代码来源:test_crashstorage.py

示例3: test_index_crash

# 需要导入模块: from socorro.external.es.crashstorage import ESCrashStorage [as 别名]
# 或者: from socorro.external.es.crashstorage.ESCrashStorage import close [as 别名]
    def test_index_crash(self):
        """Test indexing a crash document.
        """

        es_storage = ESCrashStorage(config=self.config)

        es_storage.save_raw_and_processed(
            raw_crash=a_raw_crash,
            dumps=None,
            processed_crash=a_processed_crash,
            crash_id=a_processed_crash['uuid']
        )

        # Ensure that the document was indexed by attempting to retreive it.
        ok_(
            self.es_client.get(
                index=self.config.elasticsearch.elasticsearch_index,
                id=a_processed_crash['uuid']
            )
        )
        es_storage.close()
开发者ID:ahlfors,项目名称:socorro,代码行数:23,代码来源:test_crashstorage.py


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