diff --git a/redis/commands/core.py b/redis/commands/core.py index e73553e47e..642f3edcc5 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -99,6 +99,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." diff --git a/tests/test_commands.py b/tests/test_commands.py index 6660c2c6b0..b2d7c1b9ed 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -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()