Skip to content

Commit

Permalink
Throw NotImplementedError for HELLO (#1912)
Browse files Browse the repository at this point in the history
* unsupported hello

* add test and docstring

* linters

* fix docstring

* linters

* linters
  • Loading branch information
dvora-h committed Feb 6, 2022
1 parent f9d8091 commit ba3134c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions redis/commands/core.py
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions tests/test_commands.py
Expand Up @@ -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
Expand Down

0 comments on commit ba3134c

Please sign in to comment.