diff options
-rw-r--r-- | redis/commands/cluster.py | 2 | ||||
-rw-r--r-- | redis/commands/core.py | 2 | ||||
-rw-r--r-- | tests/test_cluster.py | 10 | ||||
-rw-r--r-- | tests/test_scripting.py | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/redis/commands/cluster.py b/redis/commands/cluster.py index f434f36..a23a94a 100644 --- a/redis/commands/cluster.py +++ b/redis/commands/cluster.py @@ -52,6 +52,8 @@ READ_COMMANDS = frozenset( [ "BITCOUNT", "BITPOS", + "EVAL_RO", + "EVALSHA_RO", "EXISTS", "GEODIST", "GEOHASH", diff --git a/redis/commands/core.py b/redis/commands/core.py index 4cd0a9f..10eb048 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -5139,7 +5139,7 @@ class ScriptCommands(CommandsProtocol): """ The read-only variant of the EVAL command - Execute the read-only Lue ``script`` specifying the ``numkeys`` the script + Execute the read-only Lua ``script`` specifying the ``numkeys`` the script will touch and the key names and argument values in ``keys_and_args``. Returns the result of the script. diff --git a/tests/test_cluster.py b/tests/test_cluster.py index 9866cfc..27cfee1 100644 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -561,7 +561,15 @@ class TestRedisClusterObj: read_cluster.get("foo") read_cluster.get("foo") read_cluster.get("foo") - mocks["send_command"].assert_has_calls([call("READONLY")]) + mocks["send_command"].assert_has_calls( + [ + call("READONLY"), + call("GET", "foo"), + call("READONLY"), + call("GET", "foo"), + call("GET", "foo"), + ] + ) def test_keyslot(self, r): """ diff --git a/tests/test_scripting.py b/tests/test_scripting.py index bbe845c..b6b5f9f 100644 --- a/tests/test_scripting.py +++ b/tests/test_scripting.py @@ -67,7 +67,6 @@ class TestScripting: @skip_if_server_version_lt("7.0.0") @skip_if_redis_enterprise() - @pytest.mark.onlynoncluster def test_eval_ro(self, r): r.set("a", "b") assert r.eval_ro("return redis.call('GET', KEYS[1])", 1, "a") == b"b" @@ -157,7 +156,6 @@ class TestScripting: @skip_if_server_version_lt("7.0.0") @skip_if_redis_enterprise() - @pytest.mark.onlynoncluster def test_evalsha_ro(self, r): r.set("a", "b") get_sha = r.script_load("return redis.call('GET', KEYS[1])") |