예제 #1
0
 def test_when_password_length_less_than_8_returns_false(self):
     result, _ = Password.validate_strength('pass')
     assert result is False
예제 #2
0
 def test_when_password_has_no_digit_returns_false(self):
     result, _ = Password.validate_strength('password')
     assert result is False
예제 #3
0
 def test_when_password_has_a_lowercase_returns_lowercase_true_on_the_dict(
         self):
     _, result = Password.validate_strength('PASSWORd')
     assert result.get('lowercase') is True
예제 #4
0
 def test_when_password_has_a_symbols_returns_symbol_true_on_the_dict(self):
     _, result = Password.validate_strength('p@ssword')
     assert result.get('symbol') is True
예제 #5
0
 def test_when_password_has_no_uppercase_returns_uppercase_false_on_the_dict(
         self):
     _, result = Password.validate_strength('password')
     assert result.get('uppercase') is False
예제 #6
0
 def test_when_password_has_an_uppercase_returns_uppercase_true_on_the_dict(
         self):
     _, result = Password.validate_strength('passworD')
     assert result.get('uppercase') is True
예제 #7
0
 def test_when_password_has_no_digit_returns_digit_false_on_the_dict(self):
     _, result = Password.validate_strength('password')
     assert result.get('digit') is False
예제 #8
0
 def test_when_password_has_a_digit_returns_digit_true_on_the_dict(self):
     _, result = Password.validate_strength('password9')
     assert result.get('digit') is True
예제 #9
0
 def test_when_password_length_greather_than_7_returns_legth_true_on_the_dict(
         self):
     _, result = Password.validate_strength('password')
     assert result.get('length') is True
예제 #10
0
 def test_when_password_length_less_than_8_returns_legth_false_on_the_dict(
         self):
     _, result = Password.validate_strength('pass')
     assert result.get('length') is False
예제 #11
0
 def test_when_password_is_none_returns_false(self):
     result, _ = Password.validate_strength(None)
     assert result is False
예제 #12
0
 def test_when_password_is_strong_returns_true(self):
     result, _ = Password.validate_strength('p@ssworD9')
     assert result is True
예제 #13
0
 def test_when_password_has_no_lowercase_returns_false(self):
     result, _ = Password.validate_strength('PASSWORD9')
     assert result is False