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


Python KyotoTycoon.cursor方法代码示例

本文整理汇总了Python中pykt.KyotoTycoon.cursor方法的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon.cursor方法的具体用法?Python KyotoTycoon.cursor怎么用?Python KyotoTycoon.cursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pykt.KyotoTycoon的用法示例。


在下文中一共展示了KyotoTycoon.cursor方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_cursor_jump

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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

示例2: test_cursor_remove_fail

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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

示例3: test_cursor_get_value

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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

示例4: test_cursor_get_key

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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

示例5: test_cursor_step

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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 cursor [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 cursor [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_get_step

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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

示例9: test_cursor_set_value_expire

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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_set_value_step

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [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

示例11: test_cursor_jump_nodata

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [as 别名]
def test_cursor_jump_nodata():
    db = KyotoTycoon()
    db = db.open()
    c = db.cursor()
    c.jump()
    ok_(False)
开发者ID:mopemope,项目名称:pykt,代码行数:8,代码来源:test_cursor.py

示例12: test_cursor

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [as 别名]
def test_cursor():
    db = KyotoTycoon()
    db = db.open()
    db.set_bulk(d)
    c = db.cursor()
    ok_(isinstance(c, Cursor))
开发者ID:mopemope,项目名称:pykt,代码行数:8,代码来源:test_cursor.py

示例13: test_cursor_err

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [as 别名]
def test_cursor_err():
    db = KyotoTycoon()
    db.cursor()
开发者ID:mopemope,项目名称:pykt,代码行数:5,代码来源:test_cursor.py


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