本文整理匯總了Python中dht.storage.ForgetfulStorage.get方法的典型用法代碼示例。如果您正苦於以下問題:Python ForgetfulStorage.get方法的具體用法?Python ForgetfulStorage.get怎麽用?Python ForgetfulStorage.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dht.storage.ForgetfulStorage
的用法示例。
在下文中一共展示了ForgetfulStorage.get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get
# 需要導入模塊: from dht.storage import ForgetfulStorage [as 別名]
# 或者: from dht.storage.ForgetfulStorage import get [as 別名]
def test_get(self):
v = Value()
v.valueKey = self.key1
v.serializedData = self.value
testv = [v.SerializeToString()]
f = ForgetfulStorage()
f[self.keyword1] = (self.key1, self.value)
self.assertEqual(testv, f.get(self.keyword1))
示例2: test_get
# 需要導入模塊: from dht.storage import ForgetfulStorage [as 別名]
# 或者: from dht.storage.ForgetfulStorage import get [as 別名]
def test_get(self):
v = Value()
v.valueKey = self.key1
v.serializedData = self.value
v.ttl = 10
testv = [v.SerializeToString()]
p = ForgetfulStorage()
p[self.keyword1] = (self.key1, self.value, 10)
self.assertEqual(testv, p.get(self.keyword1))
示例3: test_ttl
# 需要導入模塊: from dht.storage import ForgetfulStorage [as 別名]
# 或者: from dht.storage.ForgetfulStorage import get [as 別名]
def test_ttl(self):
p = ForgetfulStorage()
p[self.keyword1] = (self.key1, self.value, .000000000001)
self.assertTrue(p.get(self.keyword1) is None)
示例4: test_delete
# 需要導入模塊: from dht.storage import ForgetfulStorage [as 別名]
# 或者: from dht.storage.ForgetfulStorage import get [as 別名]
def test_delete(self):
p = ForgetfulStorage()
p[self.keyword1] = (self.key1, self.value, 10)
p.delete(self.keyword1, self.key1)
self.assertEqual(p.get(self.keyword1), None)
示例5: test_delete
# 需要導入模塊: from dht.storage import ForgetfulStorage [as 別名]
# 或者: from dht.storage.ForgetfulStorage import get [as 別名]
def test_delete(self):
f = ForgetfulStorage()
f[self.keyword1] = (self.key1, self.value, 10)
f.delete(self.keyword1, self.key1)
self.assertEqual(f.get(self.keyword1), None)