Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def acl_genpass(self, bits: Union[int, None] = None, **kwargs) -> ResponseT:
b = int(bits)
if b < 0 or b > 4096:
raise ValueError
pieces.append(b)
except ValueError:
raise DataError(
"genpass optionally accepts a bits argument, between 0 and 4096."
Expand Down
3 changes: 2 additions & 1 deletion tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ def test_acl_genpass(self, r):
r.acl_genpass(-5)
r.acl_genpass(5555)

r.acl_genpass(555)
password = r.acl_genpass(555)
assert isinstance(password, (str, bytes))
assert len(password) == 139

@skip_if_server_version_lt("7.0.0")
@skip_if_redis_enterprise()
Expand Down