Skip to content

Commit e755397

Browse files
author
Yann Weber
committed
add failing test on user_inputs side effects
1 parent 566fff1 commit e755397

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/zxcvbn_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,13 @@ def test_empty_password():
4646
zxcvbn(password, user_inputs=[input_])
4747
except IndexError as ie:
4848
assert False, "Empty password raised IndexError"
49+
50+
51+
def test_user_inputs_side_effects():
52+
password = '7r3iz3|)0uz3'
53+
input_ = [password]
54+
55+
guess1 = zxcvbn(password)['guesses_log10']
56+
zxcvbn('somepassword', user_inputs=input_)
57+
guess2 = zxcvbn(password)['guesses_log10']
58+
assert abs(guess1 - guess2) < 1

0 commit comments

Comments
 (0)