Skip to content

Commit

Permalink
Merge pull request #312 from shachlanAmazon/update-main
Browse files Browse the repository at this point in the history
Update with latest changes to redis-rs.
  • Loading branch information
shachlanAmazon authored Jul 12, 2023
2 parents 2913487 + 9136227 commit 5942377
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions python/python/tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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("#")
]
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5942377

Please sign in to comment.