Skip to content
Browse files

Make StrictRedis the default

  • Loading branch information...
1 parent 37da418 commit 9b505840da47a34f758a830c3992fa5dcb7bb7ad @dcramer dcramer committed
Showing with 8 additions and 4 deletions.
  1. +4 −0 CHANGES
  2. +1 −1 nydus/db/backends/redis.py
  3. +3 −3 tests/nydus/db/backends/redis/tests.py
View
4 CHANGES
@@ -0,0 +1,4 @@
+0.11.0
+------
+
+-The StrictRedis client is now used by default.
View
2 nydus/db/backends/redis.py
@@ -38,7 +38,7 @@ class Redis(BaseConnection):
def __init__(self, num, host='localhost', port=6379, db=0, timeout=None,
password=None, unix_socket_path=None, identifier=None,
- strict=False):
+ strict=True):
self.host = host
self.port = port
self.db = db
View
6 tests/nydus/db/backends/redis/tests.py
@@ -67,7 +67,7 @@ def test_provides_retryable_exceptions(self):
def test_provides_identifier(self):
self.assertEquals(self.redis.identifier, str(self.redis.identifier))
- @mock.patch('nydus.db.backends.redis.RedisClient')
+ @mock.patch('nydus.db.backends.redis.StrictRedis')
def test_client_instantiates_with_kwargs(self, RedisClient):
client = Redis(num=0)
client.connect()
@@ -76,7 +76,7 @@ def test_client_instantiates_with_kwargs(self, RedisClient):
RedisClient.assert_any_call(host='localhost', port=6379, db=0, socket_timeout=None,
password=None, unix_socket_path=None)
- @mock.patch('nydus.db.backends.redis.RedisClient')
+ @mock.patch('nydus.db.backends.redis.StrictRedis')
def test_map_does_pipeline(self, RedisClient):
redis = create_cluster({
'backend': 'nydus.db.backends.redis.Redis',
@@ -104,7 +104,7 @@ def test_map_does_pipeline(self, RedisClient):
self.assertEquals(RedisClient().pipeline().execute.call_count, 2)
RedisClient().pipeline().execute.assert_called_with()
- @mock.patch('nydus.db.backends.redis.RedisClient')
+ @mock.patch('nydus.db.backends.redis.StrictRedis')
def test_map_only_runs_on_required_nodes(self, RedisClient):
redis = create_cluster({
'engine': 'nydus.db.backends.redis.Redis',

0 comments on commit 9b50584

Please sign in to comment.
Something went wrong with that request. Please try again.