Skip to content

Commit ba3134c

Browse files
authored
Throw NotImplementedError for HELLO (#1912)
* unsupported hello * add test and docstring * linters * fix docstring * linters * linters
1 parent f9d8091 commit ba3134c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

redis/commands/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,15 @@ def wait(self, num_replicas, timeout, **kwargs):
10871087
"""
10881088
return self.execute_command("WAIT", num_replicas, timeout, **kwargs)
10891089

1090+
def hello(self):
1091+
"""
1092+
This function throws a NotImplementedError since it is intentionally
1093+
not supported.
1094+
"""
1095+
raise NotImplementedError(
1096+
"HELLO is intentionally not implemented in the client."
1097+
)
1098+
10901099
def failover(self):
10911100
"""
10921101
This function throws a NotImplementedError since it is intentionally

tests/test_commands.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,11 @@ def test_client_getredir(self, r):
624624
assert isinstance(r.client_getredir(), int)
625625
assert r.client_getredir() == -1
626626

627+
@skip_if_server_version_lt("6.0.0")
628+
def test_hello_notI_implemented(self, r):
629+
with pytest.raises(NotImplementedError):
630+
r.hello()
631+
627632
def test_config_get(self, r):
628633
data = r.config_get()
629634
assert len(data.keys()) > 10

0 commit comments

Comments
 (0)