本文整理汇总了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)
示例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)
示例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")
示例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")
示例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")
示例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)
示例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 == "あいうえお")
示例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")
示例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")
示例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")
示例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)
示例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))
示例13: test_cursor_err
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import cursor [as 别名]
def test_cursor_err():
db = KyotoTycoon()
db.cursor()