Skip to content

Commit

Permalink
async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dvora-h committed May 2, 2022
1 parent 07217f8 commit 3553a2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 9 additions & 7 deletions redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,15 @@ def parse_acl_getuser(response, **options):
data["keys"] = list(str_if_bytes(data["keys"]).split(" "))
if data["keys"] == [""]:
data["keys"] = []
if isinstance(data["channels"], str) or isinstance(data["channels"], bytes):
data["channels"] = list(str_if_bytes(data["channels"]).split(" "))
if data["channels"] == [""]:
data["channels"] = []
data["selectors"] = [
list(map(str_if_bytes, selector)) for selector in data["selectors"]
]
if "channels" in data:
if isinstance(data["channels"], str) or isinstance(data["channels"], bytes):
data["channels"] = list(str_if_bytes(data["channels"]).split(" "))
if data["channels"] == [""]:
data["channels"] = []
if "selectors" in data:
data["selectors"] = [
list(map(str_if_bytes, selector)) for selector in data["selectors"]
]

# split 'commands' into separate 'categories' and 'commands' lists
commands, categories = [], []
Expand Down
2 changes: 2 additions & 0 deletions tests/test_asyncio/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ async def test_acl_genpass(self, r: redis.Redis):
assert isinstance(password, str)

@skip_if_server_version_lt(REDIS_6_VERSION)
@skip_if_server_version_gte("7.0.0")
async def test_acl_getuser_setuser(self, r: redis.Redis, request, event_loop):
username = "redis-py-user"

Expand Down Expand Up @@ -224,6 +225,7 @@ def teardown():
assert len((await r.acl_getuser(username))["passwords"]) == 1

@skip_if_server_version_lt(REDIS_6_VERSION)
@skip_if_server_version_gte("7.0.0")
async def test_acl_list(self, r: redis.Redis, request, event_loop):
username = "redis-py-user"

Expand Down

0 comments on commit 3553a2d

Please sign in to comment.