当前位置: 首页>>代码示例>>Python>>正文


Python KyotoTycoon.set_bulk方法代码示例

本文整理汇总了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)
开发者ID:mopemope,项目名称:pykt,代码行数:9,代码来源:test_cursor.py

示例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)
开发者ID:mopemope,项目名称:pykt,代码行数:9,代码来源:test_cursor.py

示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:12,代码来源:test_cursor.py

示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:12,代码来源:test_cursor.py

示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:13,代码来源:test_cursor.py

示例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)
开发者ID:mopemope,项目名称:pykt,代码行数:14,代码来源:test_cursor.py

示例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 == "あいうえお")
开发者ID:mopemope,项目名称:pykt,代码行数:16,代码来源:test_cursor.py

示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:17,代码来源:test_cursor.py

示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:17,代码来源:test_cursor.py

示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:17,代码来源:test_cursor.py

示例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()
开发者ID:mopemope,项目名称:pykt,代码行数:11,代码来源:test_get_bulk.py

示例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()
开发者ID:mopemope,项目名称:pykt,代码行数:11,代码来源:test_get_bulk.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:12,代码来源:test_set_bulk.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:12,代码来源:test_set_bulk.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:12,代码来源:test_set_bulk.py


注:本文中的pykt.KyotoTycoon.set_bulk方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。