本文整理汇总了Python中pykt.KyotoTycoon.set_bulk方法的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon.set_bulk方法的具体用法?Python KyotoTycoon.set_bulk怎么用?Python KyotoTycoon.set_bulk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykt.KyotoTycoon
的用法示例。
在下文中一共展示了KyotoTycoon.set_bulk方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cursor_remove_fail
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_remove_fail():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.remove()
ok_(False)
示例2: test_cursor_jump
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_jump():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
ret = c.jump()
ok_(ret == True)
示例3: test_cursor_get_key
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_get_key():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.jump()
k = c.get_key()
ok_(k == "A")
k = c.get_key()
ok_(k == "A")
示例4: test_cursor_get_value
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_get_value():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.jump()
v = c.get_value()
ok_(v == "B")
v = c.get_value()
ok_(v == "B")
示例5: test_cursor_step
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_step():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
ret = c.jump()
k, v = c.get()
c.step()
k, v = c.get()
ok_(k == "E")
ok_(v == "F")
示例6: test_cursor_remove
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_remove():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.jump()
ret = c.remove()
ok_(ret == True)
k, v = c.get()
ok_(k == "E")
ok_(v == "F")
ok_(db.get("A") == None)
示例7: test_cursor_set_value_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_set_value_utf8():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.jump()
k, v = c.get()
ok_(k == "A")
ok_(v == "B")
ret = c.set_value("あいうえお")
ok_(ret == True)
k, v = c.get()
ok_(k == "A")
ok_(v == "あいうえお")
示例8: test_cursor_set_value_step
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_set_value_step():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.jump()
k, v = c.get()
ok_(k == "A")
ok_(v == "B")
ret = c.set_value("C", True)
ok_(ret == True)
k, v = c.get()
ok_(k == "E")
ok_(v == "F")
ok_(db.get("A") == "C")
示例9: test_cursor_set_value_expire
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_set_value_expire():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.jump()
k, v = c.get()
ok_(k == "A")
ok_(v == "B")
ret = c.set_value("C", expire=2)
ok_(ret == True)
time.sleep(3)
k, v = c.get()
ok_(k == "E")
ok_(v == "F")
示例10: test_cursor_get_step
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_cursor_get_step():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.jump()
k, v = c.get(True)
ok_(k == "A")
ok_(v == "B")
k, v = c.get(True)
ok_(k == "E")
ok_(v == "F")
k, v = c.get(True)
ok_(k == "C")
ok_(v == "D")
示例11: test_get_bulk_atomic
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_get_bulk_atomic():
db = KyotoTycoon()
db.open()
ret = db.set_bulk(d2, atomic=True)
ok_(ret == 2)
ret = db.get_bulk(d2.keys(), atomic=True)
ok_(isinstance(ret, dict))
ok_(ret == d2)
db.close()
示例12: test_get_bulk_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_get_bulk_utf8():
db = KyotoTycoon()
db.open()
ret = db.set_bulk(d2)
ok_(ret == 2)
ret = db.get_bulk(d2.keys())
ok_(isinstance(ret, dict))
ok_(ret == d2)
db.close()
示例13: test_set_bulk_atomic
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_set_bulk_atomic():
db = KyotoTycoon()
db = db.open()
ret = db.set_bulk(d, atomic=True)
ok_(ret == 2)
ret = db.get("A")
ok_(ret == "B")
ret = db.get("C")
ok_(ret == "D")
db.close()
示例14: test_set_bulk
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_set_bulk():
db = KyotoTycoon()
db = db.open()
ret = db.set_bulk(d)
ok_(ret == 2)
ret = db.get("A")
ok_(ret == "B")
ret = db.get("C")
ok_(ret == "D")
db.close()
示例15: test_set_bulk_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set_bulk [as 别名]
def test_set_bulk_utf8():
db = KyotoTycoon()
db = db.open()
ret = db.set_bulk(d2)
ok_(ret == 2)
ret = db.get("あいうえお")
ok_(ret == "ABC")
ret = db.get("かきくけこ")
ok_(ret == "てすと2")
db.close()