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


Python AerospikeClientMock.remove_bin方法代碼示例

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


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

示例1: test_remove_bin

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

示例2: test_remove_bin

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


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