Mike Bayer avatar Mike Bayer committed 71a8de4

formatting

Comments (0)

Files changed (1)

tests/cache/test_memcached_backend.py

 
 class _NonDistributedMemcachedTest(_TestMemcachedConn, _GenericBackendTest):
     region_args = {
-        "key_mangler":lambda x: x.replace(" ", "_")
+        "key_mangler": lambda x: x.replace(" ", "_")
     }
     config_args = {
-        "arguments":{
-            "url":"127.0.0.1:11211"
+        "arguments": {
+            "url": "127.0.0.1:11211"
         }
     }
 
 class _DistributedMemcachedTest(_TestMemcachedConn, _GenericBackendTest):
     region_args = {
-        "key_mangler":lambda x: x.replace(" ", "_")
+        "key_mangler": lambda x: x.replace(" ", "_")
     }
     config_args = {
-        "arguments":{
-            "url":"127.0.0.1:11211",
-            "distributed_lock":True
+        "arguments": {
+            "url": "127.0.0.1:11211",
+            "distributed_lock": True
         }
     }
 
 class _DistributedMemcachedMutexTest(_TestMemcachedConn, _GenericMutexTest):
     config_args = {
-        "arguments":{
-            "url":"127.0.0.1:11211",
-            "distributed_lock":True
+        "arguments": {
+            "url": "127.0.0.1:11211",
+            "distributed_lock": True
         }
     }
 
 
 class PylibmcArgsTest(TestCase):
     def test_binary_flag(self):
-        backend = MockPylibmcBackend(arguments={'url':'foo','binary':True})
+        backend = MockPylibmcBackend(arguments={'url': 'foo','binary': True})
         eq_(backend._create_client().kw["binary"], True)
 
     def test_url_list(self):
-        backend = MockPylibmcBackend(arguments={'url':["a", "b", "c"]})
+        backend = MockPylibmcBackend(arguments={'url': ["a", "b", "c"]})
         eq_(backend._create_client().arg[0], ["a", "b", "c"])
 
     def test_url_scalar(self):
-        backend = MockPylibmcBackend(arguments={'url':"foo"})
+        backend = MockPylibmcBackend(arguments={'url': "foo"})
         eq_(backend._create_client().arg[0], ["foo"])
 
     def test_behaviors(self):
-        backend = MockPylibmcBackend(arguments={'url':"foo",
-                                    "behaviors":{"q":"p"}})
+        backend = MockPylibmcBackend(arguments={'url': "foo",
+                                    "behaviors": {"q": "p"}})
         eq_(backend._create_client().kw["behaviors"], {"q": "p"})
 
     def test_set_time(self):
-        backend = MockPylibmcBackend(arguments={'url':"foo",
-                                "memcached_expire_time":20})
+        backend = MockPylibmcBackend(arguments={'url': "foo",
+                                "memcached_expire_time": 20})
         backend.set("foo", "bar")
-        eq_(backend._clients.memcached.canary, [{"time":20}])
+        eq_(backend._clients.memcached.canary, [{"time": 20}])
 
     def test_set_min_compress_len(self):
-        backend = MockPylibmcBackend(arguments={'url':"foo",
-                                "min_compress_len":20})
+        backend = MockPylibmcBackend(arguments={'url': "foo",
+                                "min_compress_len": 20})
         backend.set("foo", "bar")
-        eq_(backend._clients.memcached.canary, [{"min_compress_len":20}])
+        eq_(backend._clients.memcached.canary, [{"min_compress_len": 20}])
 
     def test_no_set_args(self):
-        backend = MockPylibmcBackend(arguments={'url':"foo"})
+        backend = MockPylibmcBackend(arguments={'url': "foo"})
         backend.set("foo", "bar")
         eq_(backend._clients.memcached.canary, [{}])
 
 class MemcachedArgstest(TestCase):
     def test_set_time(self):
-        backend = MockMemcacheBackend(arguments={'url':"foo",
-                                "memcached_expire_time":20})
+        backend = MockMemcacheBackend(arguments={'url': "foo",
+                                "memcached_expire_time": 20})
         backend.set("foo", "bar")
-        eq_(backend._clients.memcached.canary, [{"time":20}])
+        eq_(backend._clients.memcached.canary, [{"time": 20}])
 
     def test_set_min_compress_len(self):
-        backend = MockMemcacheBackend(arguments={'url':"foo",
-                                "min_compress_len":20})
+        backend = MockMemcacheBackend(arguments={'url': "foo",
+                                "min_compress_len": 20})
         backend.set("foo", "bar")
-        eq_(backend._clients.memcached.canary, [{"min_compress_len":20}])
+        eq_(backend._clients.memcached.canary, [{"min_compress_len": 20}])
 
 
 class LocalThreadTest(TestCase):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.