當前位置: 首頁>>代碼示例>>Python>>正文


Python AerospikeClientMock.increment方法代碼示例

本文整理匯總了Python中AerospikeClientMock.AerospikeClientMock.increment方法的典型用法代碼示例。如果您正苦於以下問題:Python AerospikeClientMock.increment方法的具體用法?Python AerospikeClientMock.increment怎麽用?Python AerospikeClientMock.increment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AerospikeClientMock.AerospikeClientMock的用法示例。


在下文中一共展示了AerospikeClientMock.increment方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_undefined_incr

# 需要導入模塊: from AerospikeClientMock import AerospikeClientMock [as 別名]
# 或者: from AerospikeClientMock.AerospikeClientMock import increment [as 別名]
 def test_undefined_incr(self):
     asm = AerospikeClientMock()
     key = ("a", "b", "c")
     asm.increment(key, "a", 1)
     self.assertEqual({('a', 'b', 'c'): {'a': 1}}, asm.dump())
     self.assertEqual((('a', 'b', 'c'), {'a': 1}, {'gen': 1, 'ttl': 0}),
                      asm.get(key))
開發者ID:gitter-badger,項目名稱:aerospike-client-mock-python,代碼行數:9,代碼來源:test_AerospikeClientMock.py

示例2: test_incr_value

# 需要導入模塊: from AerospikeClientMock import AerospikeClientMock [as 別名]
# 或者: from AerospikeClientMock.AerospikeClientMock import increment [as 別名]
 def test_incr_value(self):
     asm = AerospikeClientMock()
     key = ("a", "b", "c")
     asm.put(key, {"a": 1})
     asm.increment(key, "a", 2)
     self.assertEqual({('a', 'b', 'c'): {'a': 3}}, asm.dump())
     self.assertEqual((('a', 'b', 'c'), {'gen': 2, 'ttl': 0}, {'a': 3}),
                      asm.get(key))
開發者ID:tivvit,項目名稱:aerospike-client-mock-python,代碼行數:10,代碼來源:test_AerospikeClientMock.py

示例3: test_incr

# 需要導入模塊: from AerospikeClientMock import AerospikeClientMock [as 別名]
# 或者: from AerospikeClientMock.AerospikeClientMock import increment [as 別名]
 def test_incr(self):
     default_ttl = 2
     asm = AerospikeClientMock(default_ttl=2)
     key = ("a", "b", "c")
     asm.put(key, {"a": 1})
     asm.increment(key, "a", 2)
     self.assertEqual({('a', 'b', 'c'): {'a': 3}}, asm.dump())
     self.assertEqual(
         (
             ('a', 'b', 'c'), {'a': 3},
             {'gen': 2, 'ttl': self.get_time(default_ttl)}
         ), asm.get(key))
     asm.increment(key, "a", 1, meta={"ttl": 1})
     self.assertEqual(
         (('a', 'b', 'c'), {'a': 4}, {'gen': 3, 'ttl': self.get_time(1)}),
         asm.get(key))
開發者ID:gitter-badger,項目名稱:aerospike-client-mock-python,代碼行數:18,代碼來源:test_AerospikeClientTtlMock.py


注:本文中的AerospikeClientMock.AerospikeClientMock.increment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。