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


Python KyotoTycoon.open方法代码示例

本文整理汇总了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()
开发者ID:mopemope,项目名称:pykt,代码行数:11,代码来源:test_get_bulk.py

示例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()
开发者ID:mopemope,项目名称:pykt,代码行数:11,代码来源:test_get_bulk.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:12,代码来源:test_remove_bulk.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:12,代码来源:test_remove_bulk.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:12,代码来源:test_remove_bulk.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_report.py

示例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)
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_increment_double.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_get.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_get.py

示例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")
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_add.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_status.py

示例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()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_status.py

示例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()
开发者ID:mopemope,项目名称:pykt,代码行数:9,代码来源:test_head.py

示例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()
开发者ID:mopemope,项目名称:pykt,代码行数:9,代码来源:test_head.py

示例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)
开发者ID:mopemope,项目名称:pykt,代码行数:9,代码来源:test_cursor.py


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