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


Python BatchQuery.execute方法代码示例

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


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

示例1: test_batch_is_executed

# 需要导入模块: from cqlengine.query import BatchQuery [as 别名]
# 或者: from cqlengine.query.BatchQuery import execute [as 别名]
    def test_batch_is_executed(self):
        b = BatchQuery()
        inst = TestMultiKeyModel.batch(b).create(partition=self.pkey, cluster=2, count=3, text='4')

        with self.assertRaises(TestMultiKeyModel.DoesNotExist):
            TestMultiKeyModel.get(partition=self.pkey, cluster=2)

        b.execute()
开发者ID:EverythingMe,项目名称:cqlengine,代码行数:10,代码来源:test_batch_query.py

示例2: test_delete_success_case

# 需要导入模块: from cqlengine.query import BatchQuery [as 别名]
# 或者: from cqlengine.query.BatchQuery import execute [as 别名]
    def test_delete_success_case(self):

        inst = TestMultiKeyModel.create(partition=self.pkey, cluster=2, count=3, text='4')

        b = BatchQuery()

        inst.batch(b).delete()

        TestMultiKeyModel.get(partition=self.pkey, cluster=2)

        b.execute()

        with self.assertRaises(TestMultiKeyModel.DoesNotExist):
            TestMultiKeyModel.get(partition=self.pkey, cluster=2)
开发者ID:amygdalama,项目名称:cqlengine,代码行数:16,代码来源:test_batch_query.py

示例3: test_update_success_case

# 需要导入模块: from cqlengine.query import BatchQuery [as 别名]
# 或者: from cqlengine.query.BatchQuery import execute [as 别名]
    def test_update_success_case(self):

        inst = TestMultiKeyModel.create(partition=self.pkey, cluster=2, count=3, text='4')

        b = BatchQuery()

        inst.count = 4
        inst.batch(b).save()

        inst2 = TestMultiKeyModel.get(partition=self.pkey, cluster=2)
        assert inst2.count == 3

        b.execute()

        inst3 = TestMultiKeyModel.get(partition=self.pkey, cluster=2)
        assert inst3.count == 4
开发者ID:amygdalama,项目名称:cqlengine,代码行数:18,代码来源:test_batch_query.py

示例4: test_callbacks_properly_execute_callables_and_tuples

# 需要导入模块: from cqlengine.query import BatchQuery [as 别名]
# 或者: from cqlengine.query.BatchQuery import execute [as 别名]
    def test_callbacks_properly_execute_callables_and_tuples(self):

        call_history = []
        def my_callback(*args, **kwargs):
            call_history.append(args)

        # adding on init:
        batch = BatchQuery()

        batch.add_callback(my_callback)
        batch.add_callback(my_callback, 'more', 'args')

        batch.execute()

        assert len(call_history) == 2
        assert [(), ('more', 'args')] == call_history
开发者ID:clabra,项目名称:cqlengine,代码行数:18,代码来源:test_batch_query.py

示例5: test_empty_batch

# 需要导入模块: from cqlengine.query import BatchQuery [as 别名]
# 或者: from cqlengine.query.BatchQuery import execute [as 别名]
    def test_empty_batch(self):
        b = BatchQuery()
        b.execute()

        with BatchQuery() as b:
            pass
开发者ID:bmaeser,项目名称:cqlengine,代码行数:8,代码来源:test_batch_query.py


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