diff options
author | Roey Prat <roey.prat@redislabs.com> | 2018-10-29 12:01:54 +0200 |
---|---|---|
committer | Roey Prat <roey.prat@redislabs.com> | 2018-10-31 09:34:43 +0200 |
commit | e76b8e27fa7eabf1b547724d404fb9e4d621ed7e (patch) | |
tree | e6444759ec0a53de44c1c576d7c0ae36ba72fd58 | |
parent | 1dfda00588bc02ea37b76e4465111c91dd79635e (diff) | |
download | redis-py-e76b8e27fa7eabf1b547724d404fb9e4d621ed7e.tar.gz |
fix XCLAIM to handle justid parameter correctly
-rwxr-xr-x | redis/client.py | 4 | ||||
-rw-r--r-- | tests/test_commands.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py index 762b3a5..dddaaf5 100755 --- a/redis/client.py +++ b/redis/client.py @@ -261,7 +261,7 @@ def parse_list_of_recursive_dicts(response): def parse_xclaim(response): - if isinstance(response, str): + if all(isinstance(r, (basestring, bytes)) for r in response): return response return stream_list(response) @@ -2034,7 +2034,7 @@ class StrictRedis(object): if not isinstance(justid, bool): raise RedisError("XCLAIM justid must be a boolean") pieces.append(Token.get_token('JUSTID')) - + print(pieces) return self.execute_command('XCLAIM', *pieces) # SORTED SET COMMANDS diff --git a/tests/test_commands.py b/tests/test_commands.py index a79d6a3..bacafd0 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1767,6 +1767,9 @@ class TestStrictCommands(object): b('name')] == b('action_movie_consumer') assert sr.xclaim(stream_name, group_name, 'reeves_fan', min_idle_time=0, message_ids=(stamp,))[0][0] == stamp + assert sr.xclaim(stream_name, group_name, 'action_movie_consumer', + min_idle_time=0, message_ids=(stamp,), + justid=True) == [b(stamp), ] def test_strict_zadd(self, sr): sr.zadd('a', 1.0, 'a1', 2.0, 'a2', a3=3.0) |