コード例 #1
0
ファイル: binary.test.py プロジェクト: bigbes/memcached-1
stat2 = mc.stat()
iequal(int(stat1['cmd_flush']) + 1, int(stat2['cmd_flush']))

print("""#----------------------------# diagnostics append #---------------------------#""")
key, value, suffix = "appendkey", "some value", " more"
set(key, 8, 19, value)
mc.append(key, suffix)
check(key, 19, value + suffix)

print("""#---------------------------# diagnostics prepend #---------------------------#""")
key, value, prefix = "prependkey", "some value", "more "
set(key, 8, 19, value)
mc.prepend(key, prefix)
check(key, 19, prefix + value)

print("""#------------------------------# silent append #------------------------------#""")
key, value, suffix = "appendqkey", "some value", " more"
set(key, 8, 19, value)
mc.appendq(key, suffix, nosend=True)
check_empty_response(mc)
check(key, 19, value + suffix)

print("""#------------------------------# silent prepend #-----------------------------#""")
key, value, prefix = "prependqkey", "some value", "more "
set(key, 8, 19, value)
mc.prependq(key, prefix, nosend=True)
check_empty_response(mc)
check(key, 19, prefix + value)

sys.path = saved_path
コード例 #2
0
ファイル: binary.test.py プロジェクト: zhka/memcached
stat2 = mc.stat()
iequal(int(stat1["cmd_flush"]) + 1, int(stat2["cmd_flush"]))

print ("""#----------------------------# diagnostics append #---------------------------#""")
key, value, suffix = "appendkey", "some value", " more"
set(key, 8, 19, value)
mc.append(key, suffix)
check(key, 19, value + suffix)

print ("""#---------------------------# diagnostics prepend #---------------------------#""")
key, value, prefix = "prependkey", "some value", "more "
set(key, 8, 19, value)
mc.prepend(key, prefix)
check(key, 19, prefix + value)

print ("""#------------------------------# silent append #------------------------------#""")
key, value, suffix = "appendqkey", "some value", " more"
set(key, 8, 19, value)
mc.appendq(key, suffix, nosend=True)
check_empty_response(mc)
check(key, 19, value + suffix)

print ("""#------------------------------# silent prepend #-----------------------------#""")
key, value, prefix = "prependqkey", "some value", "more "
set(key, 8, 19, value)
mc.prependq(key, prefix, nosend=True)
check_empty_response(mc)
check(key, 19, prefix + value)

sys.path = saved_path