summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonnie Kolehmainen <ronnie@esn.me>2013-01-25 14:58:17 +0100
committerRonnie Kolehmainen <ronnie@esn.me>2013-01-25 14:58:17 +0100
commitfcac7dd29b1188b03900e6cb90bbc284e0a7085c (patch)
tree296013302a091c5bbeff543f714c6deacebcd716
parentd9080116d2eaac7162533eff5721e933a1c5431d (diff)
downloadredis-py-fcac7dd29b1188b03900e6cb90bbc284e0a7085c.tar.gz
Switched callback for SREM from bool to int.
-rw-r--r--redis/client.py4
-rw-r--r--tests/server_commands.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/redis/client.py b/redis/client.py
index 4a5e8df..22da950 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -183,12 +183,12 @@ class StrictRedis(object):
RESPONSE_CALLBACKS = dict_merge(
string_keys_to_dict(
'AUTH DEL EXISTS EXPIRE EXPIREAT HDEL HEXISTS HMSET MOVE MSETNX '
- 'PERSIST RENAMENX SISMEMBER SMOVE SETEX SETNX SREM ZREM',
+ 'PERSIST RENAMENX SISMEMBER SMOVE SETEX SETNX ZREM',
bool
),
string_keys_to_dict(
'BITCOUNT DECRBY GETBIT HLEN INCRBY LINSERT LLEN LPUSHX RPUSHX '
- 'SADD SCARD SDIFFSTORE SETBIT SETRANGE SINTERSTORE STRLEN '
+ 'SADD SCARD SDIFFSTORE SETBIT SETRANGE SINTERSTORE SREM STRLEN '
'SUNIONSTORE ZADD ZCARD ZREMRANGEBYRANK ZREMRANGEBYSCORE',
int
),
diff --git a/tests/server_commands.py b/tests/server_commands.py
index 1ac5e30..23e356d 100644
--- a/tests/server_commands.py
+++ b/tests/server_commands.py
@@ -942,15 +942,15 @@ class ServerCommandsTestCase(unittest.TestCase):
def test_srem(self):
# key is not set
- self.assertEquals(self.client.srem('a', 'a'), False)
+ self.assertEquals(self.client.srem('a', 'a'), 0)
# key is not a set
self.client['a'] = 'a'
self.assertRaises(redis.ResponseError, self.client.srem, 'a', 'a')
del self.client['a']
# real logic
- self.make_set('a', 'abc')
- self.assertEquals(self.client.srem('a', 'd'), False)
- self.assertEquals(self.client.srem('a', 'b'), True)
+ self.make_set('a', 'abcd')
+ self.assertEquals(self.client.srem('a', 'e'), 0)
+ self.assertEquals(self.client.srem('a', 'b', 'd'), 2)
self.assertEquals(self.client.smembers('a'), set([b('a'), b('c')]))
def test_sunion(self):