diff options
author | Jake Barnwell <2320567+jakebarnwell@users.noreply.github.com> | 2022-02-22 07:07:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 14:07:22 +0200 |
commit | e5ac39ac7b2728d14bfc27aac989b1085b7f6199 (patch) | |
tree | dc4e64f23a73f5b85d00bacc1e6f194d2af04c9b /tests/test_command_parser.py | |
parent | 1983905d5adceaba2c3b27ba8f569dcb5387cc35 (diff) | |
download | redis-py-e5ac39ac7b2728d14bfc27aac989b1085b7f6199.tar.gz |
Add cluster support for scripting (#1937)
* Add cluster support for scripting
* Fall back to connection_pool.get_encoder if necessary
* Add documentation for cluster-based scripting
* Add test for flush response
Co-authored-by: dvora-h <dvora.heller@redis.com>
Diffstat (limited to 'tests/test_command_parser.py')
-rw-r--r-- | tests/test_command_parser.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_command_parser.py b/tests/test_command_parser.py index ad29e69..ab050a7 100644 --- a/tests/test_command_parser.py +++ b/tests/test_command_parser.py @@ -2,6 +2,8 @@ import pytest from redis.commands import CommandsParser +from .conftest import skip_if_server_version_lt + class TestCommandsParser: def test_init_commands(self, r): @@ -68,6 +70,19 @@ class TestCommandsParser: assert commands_parser.get_keys(r, *args8) is None assert commands_parser.get_keys(r, *args9).sort() == ["key1", "key2"].sort() + # A bug in redis<7.0 causes this to fail: https://github.com/redis/redis/issues/9493 + @skip_if_server_version_lt("7.0.0") + def test_get_eval_keys_with_0_keys(self, r): + commands_parser = CommandsParser(r) + args = [ + "EVAL", + "return {ARGV[1],ARGV[2]}", + 0, + "key1", + "key2", + ] + assert commands_parser.get_keys(r, *args) == [] + def test_get_pubsub_keys(self, r): commands_parser = CommandsParser(r) args1 = ["PUBLISH", "foo", "bar"] |