From d6d4415b3f8a89661cabf4e4dfe0b8cd2f67968e Mon Sep 17 00:00:00 2001 From: dvora-h Date: Tue, 26 Apr 2022 16:37:21 +0300 Subject: [PATCH] support get multi parameters --- redis/commands/core.py | 6 ++++-- tests/test_commands.py | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index 606256a33c..efcac968bb 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -752,13 +752,15 @@ def command_docs(self, *args): "COMMAND DOCS is intentionally not implemented in the client." ) - def config_get(self, pattern: PatternT = "*", **kwargs) -> ResponseT: + def config_get( + self, pattern: PatternT = "*", *args: List[PatternT], **kwargs + ) -> ResponseT: """ Return a dictionary of configuration based on the ``pattern`` For more information see https://redis.io/commands/config-get """ - return self.execute_command("CONFIG GET", pattern, **kwargs) + return self.execute_command("CONFIG GET", pattern, *args, **kwargs) def config_set(self, name: KeyT, value: EncodableT, **kwargs) -> ResponseT: """Set config item ``name`` with ``value`` diff --git a/tests/test_commands.py b/tests/test_commands.py index de94539b82..e3237ba6e4 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -669,6 +669,12 @@ def test_config_get(self, r): # # assert 'maxmemory' in data # assert data['maxmemory'].isdigit() + @skip_if_server_version_lt("7.0.0") + def test_config_get_multi_params(self, r: redis.Redis): + res = r.config_get("*max-*-entries*", "maxmemory") + assert "maxmemory" in res + assert "hash-max-listpack-entries" in res + @pytest.mark.onlynoncluster @skip_if_redis_enterprise() def test_config_resetstat(self, r):