Skip to content

Commit 6116c38

Browse files
committed
fix acl_genpass with bits (#3062)
1 parent ce6d7b4 commit 6116c38

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

redis/commands/core.py

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def acl_genpass(self, bits: Union[int, None] = None, **kwargs) -> ResponseT:
9999
b = int(bits)
100100
if b < 0 or b > 4096:
101101
raise ValueError
102+
pieces.append(b)
102103
except ValueError:
103104
raise DataError(
104105
"genpass optionally accepts a bits argument, between 0 and 4096."

tests/test_commands.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ def test_acl_genpass(self, r):
201201
r.acl_genpass(-5)
202202
r.acl_genpass(5555)
203203

204-
r.acl_genpass(555)
204+
password = r.acl_genpass(555)
205205
assert isinstance(password, (str, bytes))
206+
assert len(password) == 139
206207

207208
@skip_if_server_version_lt("7.0.0")
208209
@skip_if_redis_enterprise()

0 commit comments

Comments
 (0)