本文整理汇总了Python中pykt.KyotoTycoon类的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon类的具体用法?Python KyotoTycoon怎么用?Python KyotoTycoon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KyotoTycoon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()
开发者ID:mopemope,项目名称:pykt,代码行数:7,代码来源:test_echo.py
示例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")
开发者ID:beschulz,项目名称:kyototycoon,代码行数:7,代码来源:test_add.py
示例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)
开发者ID:beschulz,项目名称:kyototycoon,代码行数:7,代码来源:test_increment_double.py
示例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)
开发者ID:mopemope,项目名称:pykt,代码行数:7,代码来源:test_cursor.py
示例5: test_report
def test_report():
db = KyotoTycoon()
db = db.open()
ret = db.report()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:7,代码来源:test_report.py
示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:7,代码来源:test_status.py
示例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)
开发者ID:mopemope,项目名称:pykt,代码行数:7,代码来源:test_cursor.py
示例8: test_status
def test_status():
db = KyotoTycoon()
db = db.open()
ret = db.status()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:7,代码来源:test_status.py
示例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)
开发者ID:beschulz,项目名称:kyototycoon,代码行数:8,代码来源:test_status.py
示例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)
开发者ID:mopemope,项目名称:pykt,代码行数:8,代码来源:test_match_regex.py
示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:8,代码来源:test_set.py
示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:8,代码来源:test_report.py
示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:10,代码来源:test_cursor.py
示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:10,代码来源:test_cursor.py
示例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")
开发者ID:mopemope,项目名称:pykt,代码行数:11,代码来源:test_cursor.py
示例16: test_prefix_notfound
def test_prefix_notfound():
db = KyotoTycoon()
db = db.open()
db.set("BC", "B")
db.set("C", "B")
ret = db.match_prefix("A")
ok_(ret == ())
db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:8,代码来源:test_match_prefix.py
示例17: test_notfound
def test_notfound():
db = KyotoTycoon()
db = db.open()
db.set("BC", "B")
db.set("C", "B")
ret = db.match_regex("A")
ok_(ret == [])
db.close()
开发者ID:mopemope,项目名称:pykt,代码行数:8,代码来源:test_match_regex.py
示例18: test_match_regex3
def test_match_regex3():
db = KyotoTycoon()
db = db.open()
db.set("ABC", "B")
db.set("AAA", "B")
db.set("C", "B")
ret = db.match_regex("A$")
ok_(ret == ["AAA"])
db.close()
开发者ID:mopemope,项目名称:pykt,代码行数:9,代码来源:test_match_regex.py
示例19: test_match_prefix2
def test_match_prefix2():
db = KyotoTycoon()
db = db.open()
db.set("ABC", "B")
db.set("AAA", "B")
db.set("C", "B")
ret = db.match_prefix("A")
ok_(ret == ("AAA", "ABC"))
db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_match_prefix.py
示例20: test_cursor_set_value_utf8
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,代码行数:14,代码来源:test_cursor.py
注:本文中的pykt.KyotoTycoon类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论