From ba3134cd6bbd9093028badfb3f37f214b6668055 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Sun, 6 Feb 2022 13:17:45 +0200 Subject: [PATCH] Throw NotImplementedError for HELLO (#1912) * unsupported hello * add test and docstring * linters * fix docstring * linters * linters --- redis/commands/core.py | 9 +++++++++ tests/test_commands.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 139208e0b8..1b8cb80700 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1087,6 +1087,15 @@ def wait(self, num_replicas, timeout, **kwargs): """ return self.execute_command("WAIT", num_replicas, timeout, **kwargs) + def hello(self): + """ + This function throws a NotImplementedError since it is intentionally + not supported. + """ + raise NotImplementedError( + "HELLO is intentionally not implemented in the client." + ) + def failover(self): """ This function throws a NotImplementedError since it is intentionally diff --git a/tests/test_commands.py b/tests/test_commands.py index f2d5ed9e17..7d9866500f 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -624,6 +624,11 @@ def test_client_getredir(self, r): assert isinstance(r.client_getredir(), int) assert r.client_getredir() == -1 + @skip_if_server_version_lt("6.0.0") + def test_hello_notI_implemented(self, r): + with pytest.raises(NotImplementedError): + r.hello() + def test_config_get(self, r): data = r.config_get() assert len(data.keys()) > 10