本文整理汇总了Python中pykt.KyotoTycoon.open方法的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon.open方法的具体用法?Python KyotoTycoon.open怎么用?Python KyotoTycoon.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykt.KyotoTycoon
的用法示例。
在下文中一共展示了KyotoTycoon.open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_bulk_atomic
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [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()
示例2: test_get_bulk_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [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()
示例3: test_remove_bulk_atomic
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_remove_bulk_atomic():
db = KyotoTycoon()
db.open()
ret = db.set_bulk(d2, atomic=True)
ok_(ret == 2)
ret = db.remove_bulk(d2.keys(), atomic=True)
ok_(ret == 2)
ret = db.get("あいうえお")
ok_(ret == None)
db.close()
示例4: test_remove_bulk_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_remove_bulk_utf8():
db = KyotoTycoon()
db.open()
ret = db.set_bulk(d2)
ok_(ret == 2)
ret = db.remove_bulk(d2.keys())
ok_(ret == 2)
ret = db.get("あいうえお")
ok_(ret == None)
db.close()
示例5: test_remove_bulk
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_remove_bulk():
db = KyotoTycoon()
db.open()
ret = db.set_bulk(d)
ok_(ret == 2)
ret = db.remove_bulk(d.keys())
ok_(ret == 2)
ret = db.get("A")
ok_(ret == None)
db.close()
示例6: test_report
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_report():
db = KyotoTycoon()
db = db.open()
ret = db.report()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
示例7: test_increment_double_arg
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
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)
示例8: test_get_mapping_protocol
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_get_mapping_protocol():
db = KyotoTycoon()
db = db.open()
db.set("A", "B")
ret = db["A"]
ok_(ret == "B")
db.close()
示例9: test_get_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_get_utf8():
db = KyotoTycoon()
db = db.open()
db.set("あいうえお", "かきくけこ")
ret = db.get("あいうえお")
ok_(ret == "かきくけこ")
db.close()
示例10: test_dup
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
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")
示例11: test_status_loop
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_status_loop():
db = KyotoTycoon()
db = db.open()
for i in xrange(100):
ret = db.status()
ok_(ret)
db.close()
示例12: test_status
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_status():
db = KyotoTycoon()
db = db.open()
ret = db.status()
ok_(ret)
ok_(isinstance(ret, dict))
db.close()
示例13: test_head
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_head():
db = KyotoTycoon()
db = db.open()
db.set("A", "B")
ret = db.head("A")
ok_(ret == True)
db.close()
示例14: test_head_utf8
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_head_utf8():
db = KyotoTycoon()
db = db.open()
db.set("あいうえお", "かきくけこ")
ret = db.head("あいうえお")
ok_(ret == True)
db.close()
示例15: test_cursor_remove_fail
# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import open [as 别名]
def test_cursor_remove_fail():
db = KyotoTycoon()
db = db.open()
db.set_bulk(d)
c = db.cursor()
c.remove()
ok_(False)