diff options
-rw-r--r-- | redis/commands/core.py | 3 | ||||
-rw-r--r-- | tests/test_commands.py | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py index ad45adc..948655b 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -3989,6 +3989,9 @@ class ModuleCommands: def command_count(self): return self.execute_command('COMMAND COUNT') + def command_getkeys(self, *args): + return self.execute_command('COMMAND GETKEYS', *args) + def command(self): return self.execute_command('COMMAND') diff --git a/tests/test_commands.py b/tests/test_commands.py index 780a1bf..b4d371a 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -3797,6 +3797,15 @@ class TestRedisCommands: assert res >= 100 @skip_if_server_version_lt('2.8.13') + def test_command_getkeys(self, r): + res = r.command_getkeys('MSET', 'a', 'b', 'c', 'd', 'e', 'f') + assert res == [b'a', b'c', b'e'] + res = r.command_getkeys('EVAL', '"not consulted"', + '3', 'key1', 'key2', 'key3', + 'arg1', 'arg2', 'arg3', 'argN') + assert res == [b'key1', b'key2', b'key3'] + + @skip_if_server_version_lt('2.8.13') def test_command(self, r): res = r.command() assert len(res) >= 100 |