本文整理汇总了Python中pykt.KyotoTycoon.append方法的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon.append方法的具体用法?Python KyotoTycoon.append怎么用?Python KyotoTycoon.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykt.KyotoTycoon
的用法示例。
在下文中一共展示了KyotoTycoon.append方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_duble
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_duble():
db = KyotoTycoon()
db = db.open()
ret = db.append("A", "B")
ok_(ret == True)
ok_(db.get("A") == "B")
ret = db.append("A", "B")
ok_(ret == True)
ok_(db.get("A") == "BB")
示例2: test_append_large
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_append_large():
db = KyotoTycoon()
db = db.open()
ret = db.append("L", "L" * 1024 * 1024 * 1)
ok_(ret)
ret = db.get("L")
ok_(ret == "L" * 1024 * 1024 * 1)
db.close()
示例3: test_append_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_append_utf8():
db = KyotoTycoon()
db = db.open()
ret = db.append("あいうえお", "かきくけこ")
ok_(ret)
ret = db.get("あいうえお")
ok_(ret == "かきくけこ")
db.close()
示例4: test_append
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_append():
db = KyotoTycoon()
db = db.open()
ret = db.append("A", "B")
ok_(ret)
ret = db.get("A")
ok_(ret == "B")
db.close()
示例5: test_append_expire
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_append_expire():
db = KyotoTycoon()
db = db.open()
ret = db.append("A", "B", expire=2)
ok_(ret)
time.sleep(3)
ret = db.get("A")
ok_(ret == None)
db.close()
示例6: test_loop
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_loop():
db = KyotoTycoon()
db = db.open()
for i in xrange(100):
ret = db.append("A", "B")
ok_(ret)
ret = db.get("A")
ok_(ret == "B" * (i + 1))
db.close()
示例7: test_append_with_db
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_append_with_db():
db = KyotoTycoon("test")
db = db.open()
ret = db.append("A", "B")
ok_(False)
示例8: test_err_append
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import append [as 别名]
def test_err_append():
db = KyotoTycoon()
db.append("A", "B")