本文整理汇总了Python中pykt.KyotoTycoon类的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon类的具体用法?Python KyotoTycoon怎么用?Python KyotoTycoon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KyotoTycoon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_echo_loop
def test_echo_loop():
db = KyotoTycoon()
db = db.open()
for i in xrange(100):
ret = db.echo()
ok_(ret == True)
db.close()
示例2: test_dup
def test_dup():
db = KyotoTycoon()
db = db.open()
ret = db.add("A", "B")
ok_(ret == True)
ok_(db.get("A") == "B")
ret = db.add("A", "B")
示例3: test_increment_double_arg
def test_increment_double_arg():
db = KyotoTycoon()
db = db.open()
ret = db.increment_double("ID")
ok_(ret == 1.0)
ret = db.increment_double("ID", 100.1)
ok_(ret == 101.1)
示例4: test_cursor_jump
def test_cursor_jump():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
ret = c.jump()
ok_(ret == True)
示例5: test_report
def test_report():
db = KyotoTycoon()
db = db.open()
ret = db.report()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
示例6: test_status_loop
def test_status_loop():
db = KyotoTycoon()
db = db.open()
for i in xrange(100):
ret = db.status()
ok_(ret)
db.close()
示例7: test_cursor_remove_fail
def test_cursor_remove_fail():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.remove()
ok_(False)
示例8: test_status
def test_status():
db = KyotoTycoon()
db = db.open()
ret = db.status()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
示例9: test_status_with_db
def test_status_with_db():
db = KyotoTycoon("test")
db = db.open()
ret = db.status()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
ok_(False)
示例10: test_match_regex_with_db
def test_match_regex_with_db():
db = KyotoTycoon("test")
db = db.open()
db.set("ABC", "B")
db.set("BC", "B")
db.set("C", "B")
db.match_regex("A")
ok_(false)
示例11: test_mapping_protocol
def test_mapping_protocol():
db = KyotoTycoon()
db = db.open()
ret = db["M"] = "MAP"
ok_(ret)
ret = db.get("M")
ok_(ret == "MAP")
db.close()
示例12: test_report_loop
def test_report_loop():
db = KyotoTycoon()
db = db.open()
for i in xrange(100):
ret = db.report()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
示例13: test_cursor_get_key
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")
示例14: test_cursor_get_value
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")
示例15: test_cursor_step
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")