Commits

Anonymous committed 4dbfea1

Simple proxy backend for redis-py added, heavy get test renamed to test_pure_get, other tests restored

  • Participants
  • Parent commits 548d370

Comments (0)

Files changed (3)

 *.swo
 *.egg
 *.orig
+*.prof
+*.out
 *~
 *.DS_Store
 Thumbs.db
+import redis
+
+class Client(object):
+    def __init__(self, dummyparam):
+        self.client = redis.Redis(host='localhost', port=6379, db=1)
+
+    def __getattr__(self, attr):
+        if attr in self.__dict__:
+            return self.__dict__[attr]
+        else:
+            return getattr(self.client, attr)
+
+    def __iter__(self):
+        return iter(self.client)
 
 import time
 import random
-import string
 import sys
 
 
         self.options = options
         self.key_prefix =  key_prefix
         self.init_server()
-        # self.test_set()
+        self.test_set()
         self.test_set_get()
-        # self.test_random_get()
-        # self.test_set_same()
-        # self.test_set_big_object()
-        # self.test_set_get_big_object()
-        # self.test_set_big_string()
-        # self.test_set_get_big_string()
-        # self.test_get()
-        # self.test_get_big_object()
-        # self.test_get_multi()
-        # self.test_p_app_get()
+        self.test_pure_get()
+        self.test_random_get()
+        self.test_set_same()
+        self.test_set_big_object()
+        self.test_set_get_big_object()
+        self.test_set_big_string()
+        self.test_set_get_big_string()
+        self.test_get()
+        self.test_get_big_object()
+        self.test_get_multi()
+        self.test_p_app_get()
         #self.test_get_list()
 
     def init_server(self):
         get_ = self.mc.get
         pairs = zip(self.keys, self.values)
 
+        def test():
+            for key, value in pairs:
+                set_(key, value)
+                result = get_(key)
+                assert result == value
+        run_test(test, 'test_set_get')
+
+        for key, value in pairs:
+          self.mc.delete(key)
+
+    def test_pure_get(self):
+        set_ = self.mc.set
+        get_ = self.mc.get
+        pairs = zip(self.keys, self.values)
+
         for key, value in pairs:
             set_(key, value)
 
                     assert result == value
 
 
-        run_test(test, 'test_set_get')
+        run_test(test, 'test_pure_get')
 
         for key, value in pairs:
           self.mc.delete(key)
 
+
     def test_random_get(self):
         get_ = self.mc.get
         set_ = self.mc.set
     # import cmemcached
     import memcache
     import pylibmc
+    import redispy
     import handlersocket
     import handlersocket_innodb
 
         # ('cmemcached', cmemcached),
         ('memcache', memcache),
         ('pylibmc', pylibmc),
+        ('redispy', redispy),
         ('handlersocket myisam', handlersocket),
         ('handlersocket innodb', handlersocket_innodb),
     ]