From a12f2e84bc31851a8a439cd7bcf8af901696d4fa Mon Sep 17 00:00:00 2001 From: Shachar Langbeheim Date: Mon, 10 Jul 2023 13:33:02 +0000 Subject: [PATCH 1/2] Update with latest changes to redis-rs. --- submodules/redis-rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/redis-rs b/submodules/redis-rs index 53d7816563..3d4d3cb035 160000 --- a/submodules/redis-rs +++ b/submodules/redis-rs @@ -1 +1 @@ -Subproject commit 53d781656382ad470af1d058864fdb155f1db7dd +Subproject commit 3d4d3cb03590966b5127a5289eea30d8583a3f8d From 9136227f67dcbb5e968e9a72d330119660710408 Mon Sep 17 00:00:00 2001 From: Shachar Langbeheim Date: Wed, 12 Jul 2023 09:15:30 +0000 Subject: [PATCH 2/2] fix python tests --- python/python/tests/test_async_client.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/python/python/tests/test_async_client.py b/python/python/tests/test_async_client.py index e1bec39553..368ff33d27 100644 --- a/python/python/tests/test_async_client.py +++ b/python/python/tests/test_async_client.py @@ -2,7 +2,7 @@ import random import string from datetime import datetime, timedelta -from typing import Dict +from typing import Dict, List import pytest from packaging import version @@ -42,7 +42,12 @@ async def async_socket_client(request, cluster_mode) -> RedisAsyncSocketClient: client.close() -def parse_info_response(res: str) -> Dict[str, str]: +def to_str(res: str | List[str]) -> str: + return res[0] if isinstance(res, list) else res + + +def parse_info_response(res: str | List[str]) -> Dict[str, str]: + res = to_str(res) info_lines = [ line for line in res.splitlines() if line and not line.startswith("#") ] @@ -170,8 +175,10 @@ async def test_custom_command_multi_arg( self, async_socket_client: RedisAsyncSocketClient ): # Test multi args command - res: str = await async_socket_client.custom_command( - ["CLIENT", "LIST", "TYPE", "NORMAL"] + res: str = to_str( + await async_socket_client.custom_command( + ["CLIENT", "LIST", "TYPE", "NORMAL"] + ) ) assert res is not None assert "id" in res @@ -182,8 +189,10 @@ async def test_custom_command_lower_and_upper_case( self, async_socket_client: RedisAsyncSocketClient ): # Test multi args command - res: str = await async_socket_client.custom_command( - ["client", "LIST", "type", "NORMAL"] + res: str = to_str( + await async_socket_client.custom_command( + ["client", "LIST", "type", "NORMAL"] + ) ) assert res is not None assert "id" in res