當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。