summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshacharPash <shachar.pashchur@redis.com>2023-03-23 12:57:16 +0200
committershacharPash <shachar.pashchur@redis.com>2023-03-23 12:57:16 +0200
commit61c9ba93bba37e3f89f7b7584ebec83fb6e7dd81 (patch)
tree897311fa705fc00b64a8553eee260a16f09ede5f
parent082d20e95011e267fda9fe52c2f74f7f95f5a696 (diff)
downloadredis-py-AsyncCommandsTests.tar.gz
add async tests: test_client_info, test_client_list_types_not_replica, test_client_list_replicaAsyncCommandsTests
-rw-r--r--tests/test_asyncio/test_commands.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_asyncio/test_commands.py b/tests/test_asyncio/test_commands.py
index 2289f8d..aaed5f6 100644
--- a/tests/test_asyncio/test_commands.py
+++ b/tests/test_asyncio/test_commands.py
@@ -377,6 +377,27 @@ class TestRedisCommands:
assert isinstance(clients[0], dict)
assert "addr" in clients[0]
+ @pytest.mark.onlynoncluster
+ @skip_if_server_version_lt("6.2.0")
+ async def test_client_info(self, r: redis.Redis):
+ info = await r.client_info()
+ assert isinstance(info, dict)
+ assert "addr" in info
+
+ @pytest.mark.onlynoncluster
+ @skip_if_server_version_lt("5.0.0")
+ async def test_client_list_types_not_replica(self, r: redis.Redis):
+ with pytest.raises(exceptions.RedisError):
+ await r.client_list(_type="not a client type")
+ for client_type in ["normal", "master", "pubsub"]:
+ clients = await r.client_list(_type=client_type)
+ assert isinstance(clients, list)
+
+ @skip_if_redis_enterprise()
+ async def test_client_list_replica(self, r: redis.Redis):
+ clients = await r.client_list(_type="replica")
+ assert isinstance(clients, list)
+
@skip_if_server_version_lt("5.0.0")
async def test_client_list_type(self, r: redis.Redis):
with pytest.raises(exceptions.RedisError):