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


Python IndexQ.get_todo_items方法代码示例

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


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

示例1: test_locking

# 需要导入模块: from SolrClient import IndexQ [as 别名]
# 或者: from SolrClient.IndexQ import get_todo_items [as 别名]
 def test_locking(self):
     '''
     Working on this one, it doesn't lock properly
     '''
     files = 5
     index = IndexQ(test_config['indexqbase'], 'testq')
     buff = []
     docs = []
     for _ in range(files):
         doc = index.add(self.docs,finalize=True)
         docs.append(doc)
     index = IndexQ(test_config['indexqbase'], 'testq', mode='out',devel=True)
     x = index.get_todo_items()
     self.assertTrue(os.path.exists(index._lck))
     with self.assertRaises(RuntimeError) as a:
         new_index = IndexQ(test_config['indexqbase'], 'testq', mode='out')
         y = new_index.get_todo_items()
     [index.complete(i) for i in x]
     self.assertFalse(os.path.exists(index._lck))
开发者ID:hartym,项目名称:SolrClient,代码行数:21,代码来源:test_indexq.py

示例2: test_dequeue

# 需要导入模块: from SolrClient import IndexQ [as 别名]
# 或者: from SolrClient.IndexQ import get_todo_items [as 别名]
 def test_dequeue(self):
     size = 1
     files = 2
     index = IndexQ(test_config['indexqbase'], 'testq', size=size)
     buff = []
     docs = []
     for _ in range(files):
         doc = index.add(self.docs,finalize=True)
         docs.append(doc)
     index = IndexQ(test_config['indexqbase'], 'testq')
     indexdocs = []
     for x in index.get_todo_items():
         indexdocs.append(x)
     self.assertEqual(docs,indexdocs)
     [os.remove(doc) for doc in docs]
开发者ID:cyberj0g,项目名称:SolrClient,代码行数:17,代码来源:test_indexq.py

示例3: test_dequeue_100

# 需要导入模块: from SolrClient import IndexQ [as 别名]
# 或者: from SolrClient.IndexQ import get_todo_items [as 别名]
 def test_dequeue_100(self):
     size = 1
     files = 100
     rdocs = self.rand_docs.get_docs(500)
     index = IndexQ(test_config['indexqbase'], 'testq', size=size)
     buff = []
     docs = []
     for dir in ['_todo_dir','_done_dir']:
         [os.remove(x) for x in index.get_all_as_list(dir=dir)]
     for _ in range(files):
         doc = index.add(rdocs,finalize=True)
         docs.append(doc)
     index = IndexQ(test_config['indexqbase'], 'testq')
     indexdocs = []
     for x in index.get_todo_items():
         indexdocs.append(x)
     self.assertEqual(docs,indexdocs)
     [os.remove(doc) for doc in docs]
开发者ID:cyberj0g,项目名称:SolrClient,代码行数:20,代码来源:test_indexq.py

示例4: test_dequeue_and_complete_no_compression_5

# 需要导入模块: from SolrClient import IndexQ [as 别名]
# 或者: from SolrClient.IndexQ import get_todo_items [as 别名]
    def test_dequeue_and_complete_no_compression_5(self):
        size = 1
        files = 5
        index = IndexQ(test_config['indexqbase'], 'testq', size=size)
        buff = []
        docs = []
        for _ in range(files):
            doc = index.add(self.docs,finalize=True)
            sleep(1)
            docs.append(doc)
        index = IndexQ(test_config['indexqbase'], 'testq', compress=False)
        indexdocs = []
        for x in index.get_todo_items():
            indexdocs.append(x)
            index.complete(x)
        self.assertEqual(docs,indexdocs)

        finaldocnames = [os.path.split(x)[-1] for x in indexdocs]
        donefilepaths = [os.path.join(index._done_dir,x) for x in finaldocnames]
        for x in donefilepaths:
            self.assertTrue(os.path.exists(x))
        [os.remove(doc) for doc in donefilepaths]
开发者ID:hartym,项目名称:SolrClient,代码行数:24,代码来源:test_indexq.py


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