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


Python KyotoTycoon.set方法代码示例

本文整理汇总了Python中pykt.KyotoTycoon.set方法的典型用法代码示例。如果您正苦于以下问题:Python KyotoTycoon.set方法的具体用法?Python KyotoTycoon.set怎么用?Python KyotoTycoon.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pykt.KyotoTycoon的用法示例。


在下文中一共展示了KyotoTycoon.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_utf8

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [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

示例2: test_head

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [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

示例3: test_get_mapping_protocol

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [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

示例4: test_head_utf8

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [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

示例5: test_get

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_get():
    db = KyotoTycoon()
    db = db.open()
    db.set("A", "B")
    ret = db.get("A")
    ok_(ret == "B")
    db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:9,代码来源:test_get.py

示例6: test_get_loop

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_get_loop():
    db = KyotoTycoon()
    db = db.open()
    db.set("A", "B")
    for i in xrange(100):
        ret = db.get("A")
        ok_(ret == "B")
    db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:10,代码来源:test_get.py

示例7: test_head_loop

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_head_loop():
    db = KyotoTycoon()
    db = db.open()
    db.set("A", "B")
    for i in xrange(100):
        ret = db.head("A")
        ok_(ret == True)
    db.close()
开发者ID:mopemope,项目名称:pykt,代码行数:10,代码来源:test_head.py

示例8: test_notfound

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
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,代码行数:10,代码来源:test_match_regex.py

示例9: test_prefix_notfound

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
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,代码行数:10,代码来源:test_match_prefix.py

示例10: test_replace_large_key

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_replace_large_key():
    db = KyotoTycoon()
    db = db.open()
    db.set("L" * 1024 * 4, "1")
    ret = db.replace("L" * 1024 * 4, "L")
    ok_(ret) 
    ret = db.get("L" * 1024 * 4)
    ok_(ret == "L")
    db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:11,代码来源:test_replace.py

示例11: test_replace_utf8

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_replace_utf8():
    db = KyotoTycoon()
    db = db.open()
    db.set("あいうえお", "1")
    ret = db.replace("あいうえお", "かきくけこ")
    ok_(ret) 
    ret = db.get("あいうえお")
    ok_(ret == "かきくけこ")
    db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:11,代码来源:test_replace.py

示例12: test_replace

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_replace():
    db = KyotoTycoon()
    db = db.open()
    db.set("A", "1")
    ret = db.replace("A", "B")
    ok_(ret)
    ret = db.get("A")
    ok_(ret == "B")
    db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:11,代码来源:test_replace.py

示例13: test_cas

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_cas():
    db = KyotoTycoon()
    db = db.open()
    db.set("A", "B")
    ret = db.cas("A", oval="B", nval="C")
    ok_(ret == True)
    ret = db.get("A")
    ok_(ret == "C")
    db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:11,代码来源:test_cas.py

示例14: test_match_prefix2

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
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,代码行数:11,代码来源:test_match_prefix.py

示例15: test_cas_few_param2

# 需要导入模块: from pykt import KyotoTycoon [as 别名]
# 或者: from pykt.KyotoTycoon import set [as 别名]
def test_cas_few_param2():
    db = KyotoTycoon()
    db = db.open()
    db.set("A", "B")
    ret = db.cas("A", oval="B")
    ok_(ret == True)
    ret = db.get("A")
    ok_(ret == None)
    db.close()
开发者ID:beschulz,项目名称:kyototycoon,代码行数:11,代码来源:test_cas.py


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