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


Python DotDict.datastore_name方法代码示例

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


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

示例1: test_get_last_granule

# 需要导入模块: from pyon.util.containers import DotDict [as 别名]
# 或者: from pyon.util.containers.DotDict import datastore_name [as 别名]
    def test_get_last_granule(self, mock_bb, dsm_cli, dsm):

        mock_bb().sync_rdt_with_coverage = Mock()
        mock_bb().to_granule.return_value = {'test':True}

        dsm_cli().read_dataset = Mock()
        dataset = DotDict()
        dataset.datastore_name = 'test'
        dataset.view_name = 'bogus/view'

        dsm._get_coverage = Mock()
        dsm._get_coverage.return_value = {}
        
        datastore = DotDict()
        datastore.query_view = Mock()
        datastore.query_view.return_value = [{'doc':{'ts_create':0}}]

        
        container = DotDict()
        container.datastore_manager.get_datastore = Mock()
        container.datastore_manager.get_datastore.return_value = datastore

        retval = self.replay.get_last_granule(container,'dataset_id')

        self.assertEquals(retval,{'test':True})
开发者ID:pombredanne,项目名称:coi-services,代码行数:27,代码来源:replay_process_test.py

示例2: test_persist_data_stream

# 需要导入模块: from pyon.util.containers import DotDict [as 别名]
# 或者: from pyon.util.containers.DotDict import datastore_name [as 别名]
    def test_persist_data_stream(self):
        ingestval = DotDict()
        ingestval.queues = None
        ingestval.exchange_point = "test"

        queueval = DotDict()
        queueval.name = "test"
        queueval.datastore_name = "test"

        testval = "dataset_id"

        self.ingestion_management.read_ingestion_configuration = Mock()
        self.ingestion_management.read_ingestion_configuration.return_value = ingestval
        self.ingestion_management._determine_queue = Mock()
        self.ingestion_management._determine_queue.return_value = queueval
        self.pubsub_read.return_value = DotDict({"persisted": False})

        self.ingestion_management._existing_dataset = Mock()

        retval = self.ingestion_management.persist_data_stream("stream_id", "config_id", "dataset_id")

        self.assertTrue(self.pubsub_act_sub.call_count)
        self.assertTrue(self.pubsub_create_sub.call_count)
        self.assertTrue(self.rr_create_assoc.call_count)

        self.assertTrue(retval == testval)
开发者ID:pombredanne,项目名称:coi-services,代码行数:28,代码来源:ingestion_management_test.py

示例3: test_index_bootstrap

# 需要导入模块: from pyon.util.containers import DotDict [as 别名]
# 或者: from pyon.util.containers.DotDict import datastore_name [as 别名]
    def test_index_bootstrap(self, mock_es, ims_cli):
        #---------------------------------------------
        # Mocks
        #---------------------------------------------
        mock_es().index_create.return_value         = {'ok':True, 'status':200}
        mock_es().raw.return_value                  = {'ok':True, 'status':200}
        mock_es().river_couchdb_create.return_value = {'ok':True, 'status':200}

        db = DotDict()
        db.datastore_name = 'test'
        db.server.test.create = Mock()
        
        container = DotDict()
        container.datastore_manager.get_datastore = Mock()
        container.datastore_manager.get_datastore.return_value = db
        
        config = CFG
        config.system.force_clean=False
        config.system.elasticsearch=True
        config.server.elasticsearch.host = ''
        config.server.elasticsearch.port = ''
        config.op = 'index_bootstrap'
        
        #---------------------------------------------
        # Execution
        #---------------------------------------------
        ibs = IndexBootStrap()
        ibs.CFG = config
        ibs.container = container
        ibs.on_start()

        index_count = len(STD_INDEXES) + len(EDGE_INDEXES) + 1 # for _river
        self.assertTrue(mock_es().index_create.call_count == index_count, '(%s != %s) Improper number of indices created' %(mock_es().index_create.call_count , index_count))

        river_count = len(STD_INDEXES) + len(EDGE_INDEXES)
        self.assertTrue(mock_es().river_couchdb_create.call_count == river_count, 'Improper number of rivers created')

        total_count = len(STD_INDEXES) + len(COUCHDB_INDEXES) + len(EDGE_INDEXES)
        self.assertTrue(ims_cli().create_index.call_count == total_count, 'Improper number of index resources created')
开发者ID:dstuebe,项目名称:coi-services,代码行数:41,代码来源:test_index_bootstrap.py


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