本文整理汇总了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)