diff options
author | Chayim I. Kirshen <c@kirshen.com> | 2021-08-23 16:34:21 +0300 |
---|---|---|
committer | Chayim I. Kirshen <c@kirshen.com> | 2021-08-23 16:34:21 +0300 |
commit | 7bc202d1fa3c54aba1eceb0e9213e3e54aec2e49 (patch) | |
tree | 646cb79a00163311d97d5320c575b642bd47f51b /tests/test_sentinel.py | |
parent | c058c9c4e0982c143b502ee2cdbd243eb7f0070b (diff) | |
download | redis-py-ck-sentinel-commands.tar.gz |
flake8ck-sentinel-commands
Diffstat (limited to 'tests/test_sentinel.py')
-rw-r--r-- | tests/test_sentinel.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_sentinel.py b/tests/test_sentinel.py index cb59911..54cf262 100644 --- a/tests/test_sentinel.py +++ b/tests/test_sentinel.py @@ -35,8 +35,10 @@ class SentinelTestClient: from redis.client import bool_ok return bool_ok + class SentinelTestCluster: - def __init__(self, servisentinel_ce_name='mymaster', ip='127.0.0.1', port=6379): + def __init__(self, servisentinel_ce_name='mymaster', ip='127.0.0.1', + port=6379): self.clients = {} self.master = { 'ip': ip, @@ -83,6 +85,7 @@ def test_discover_master(sentinel, master_ip): address = sentinel.discover_master('mymaster') assert address == (master_ip, 6379) + def test_discover_master_error(sentinel): with pytest.raises(MasterNotFoundError): sentinel.discover_master('xxx') @@ -202,12 +205,15 @@ def test_slave_round_robin(cluster, sentinel, master_ip): with pytest.raises(SlaveNotFoundError): next(rotator) + def test_ckquorum(cluster, sentinel): assert sentinel.sentinel_ckquorum("mymaster") + def test_flushconfig(cluster, sentinel): assert sentinel.sentinel_flushconfig() + def test_reset(cluster, sentinel): cluster.master['is_odown'] = True assert sentinel.sentinel_reset('mymaster') |