import os import sys import inspect import traceback saved_path = sys.path[:] sys.path.append( os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda: 0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import MemcachedTextConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level=1): if (left != right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % ( tb[0], tb[1], repr(left), repr(right)) return False return True def inequal(left, right, level=0): if (left == right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False
import os import sys import shlex import inspect import traceback from subprocess import PIPE, Popen, STDOUT saved_path = sys.path[:] sys.path.append(os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda:0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) mc.flush() cmd = shlex.split('capable/memcapable -a -p %s -h %s -v' % (iproto.py_con.port, '127.0.0.1')) task = Popen(cmd, stdout=PIPE, stderr=STDOUT) print task.communicate()[0] sys.path = saved_path
import os import sys import inspect import traceback saved_path = sys.path[:] sys.path.append( os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda: 0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level=1): if (left != right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % ( tb[0], tb[1], repr(left), repr(right)) return False return True def inequal(left, right, level=0): if (left == right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True
import os import sys import time import inspect import traceback saved_path = sys.path[:] sys.path.append(os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda:0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level = 1): if (left != right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True def issert(stmt, level = 1): if not bool(stmt): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: result is False" % (tb[0], tb[1]) return False return True def __check(res, flags, val, level = 0): return iequal(res.get('flags', -1), flags, level + 1) and \
import os import sys import time import inspect import traceback saved_path = sys.path[:] sys.path.append(os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda:0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level = 1): if (left != right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % (tb[0], tb[1], repr(left), repr(right)) if (isinstance(left, basestring)): if (len(left) != len(right)): print("length is different") return False return True def __check(res, flags, val, level = 0): return iequal(res.get('flags', -1), flags, level + 1) and \ iequal(res.get('val', val), val, level + 1) def check(key, flags, val, level = 0): res = mc.get(key)
import os import sys import inspect import traceback saved_path = sys.path[:] sys.path.append(os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda:0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level = 1): if (left != right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True def inequal(left, right, level = 0): if (left == right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True def issert(stmt, level = 0): if bool(stmt):
import os import sys import shlex import inspect import traceback from subprocess import PIPE, Popen, STDOUT saved_path = sys.path[:] sys.path.append( os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda: 0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) mc.flush() cmd = shlex.split('capable/memcapable -b -p %s -h %s -v' % (iproto.py_con.port, '127.0.0.1')) task = Popen(cmd, stdout=PIPE, stderr=STDOUT) print task.communicate()[0] sys.path = saved_path
import os import sys import inspect import traceback saved_path = sys.path[:] sys.path.append(os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda: 0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level=1): if left != right: tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True def inequal(left, right, level=0): if left == right: tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True def issert(stmt, level=0):
import os import sys import time import inspect import traceback saved_path = sys.path[:] sys.path.append( os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda: 0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level=1): if (left != right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % ( tb[0], tb[1], repr(left), repr(right)) return False return True def issert(stmt, level=1): if not bool(stmt): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: result is False" % (tb[0], tb[1]) return False return True
import os import sys import inspect import traceback saved_path = sys.path[:] sys.path.append(os.path.dirname(os.path.abspath(inspect.getsourcefile(lambda:0)))) from internal.memcached_connection import MemcachedBinaryConnection from internal.memcached_connection import MemcachedTextConnection from internal.memcached_connection import STATUS, COMMANDS mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port) def iequal(left, right, level = 1): if (left != right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s not equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True def inequal(left, right, level = 0): if (left == right): tb = traceback.extract_stack()[-(level + 1)] print "Error on line %s:%d: %s equal %s" % (tb[0], tb[1], repr(left), repr(right)) return False return True def issert(stmt, level = 0):