forked from p15670423/monkey
Added unit test of random password generator
This commit is contained in:
parent
c77965585c
commit
58b04ecb91
|
@ -0,0 +1,13 @@
|
|||
from infection_monkey.utils.random_password_generator import get_random_password
|
||||
|
||||
|
||||
def test_get_random_password__length():
|
||||
password_byte_length = len(get_random_password().encode())
|
||||
# 32 is the recommended secure byte length for secrets
|
||||
assert password_byte_length >= 32
|
||||
|
||||
|
||||
def test_get_random_password__randomness():
|
||||
random_password1 = get_random_password()
|
||||
random_password2 = get_random_password()
|
||||
assert not random_password1 == random_password2
|
Loading…
Reference in New Issue