diff options
author | dvora-h <67596500+dvora-h@users.noreply.github.com> | 2022-02-06 12:05:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 12:05:39 +0200 |
commit | f9d8091bec3e83cbc0a699ac7b79894559ee0b3f (patch) | |
tree | 1d0d82570c1a8879c395996ac0743bc7d9cdea73 | |
parent | d7dab861280ecd7dece8d96b3d05cea85d7abac2 (diff) | |
download | redis-py-f9d8091bec3e83cbc0a699ac7b79894559ee0b3f.tar.gz |
Throw NotImplementedError for FAILOVER (#1911)
* unsupported failover
* add test and docstring
* fix docstring
-rw-r--r-- | redis/commands/core.py | 9 | ||||
-rw-r--r-- | tests/test_commands.py | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py index 99bf14d..139208e 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -1087,6 +1087,15 @@ class ManagementCommands: """ return self.execute_command("WAIT", num_replicas, timeout, **kwargs) + def failover(self): + """ + This function throws a NotImplementedError since it is intentionally + not supported. + """ + raise NotImplementedError( + "FAILOVER is intentionally not implemented in the client." + ) + class BasicKeyCommands: """ diff --git a/tests/test_commands.py b/tests/test_commands.py index 6ee204b..f2d5ed9 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -647,6 +647,11 @@ class TestRedisCommands: assert r.config_set("timeout", 0) assert r.config_get()["timeout"] == "0" + @skip_if_server_version_lt("6.0.0") + def test_failover(self, r): + with pytest.raises(NotImplementedError): + r.failover() + @pytest.mark.onlynoncluster def test_dbsize(self, r): r["a"] = "foo" |