def test_change_pswd_valid_length_similar(self, length, add_diff_ratio): """TestIdx: 1, 3, 5 [Old, new password length]: Valid various lengths [Similarity] Similar """ old_pswd = pswd_generator(length=length) new_pswd = pswd_changer(old_pswd, diff_ratio=(1 - SIMILARITY_THRESHOLD + add_diff_ratio)) assert not change_pswd(old_pswd, new_pswd)
def test_verify_pswd_num_less_than_half_of_length_even(self, length): assert verify_pswd( pswd_generator(pswd_base='!1', length=length, incl_sp_char=False))
def test_change_pswd_num_more_than_half_of_length_odd(self, length): old_pswd = pswd_generator() new_pwsd = pswd_generator(pswd_base='!123', length=length, incl_sp_char=False) assert not change_pswd(old_pswd, new_pwsd)
def test_change_pswd_valid_length_less_than_100(self, length): old_pswd = pswd_generator(length=length) new_pswd = pswd_changer(old_pswd, diff_ratio=0.3) assert change_pswd(old_pswd, new_pswd)
def test_verify_pswd_over_continuous_same_char_num( self, continous_num): assert not verify_pswd( pswd_generator(pswd_base='a' * continous_num))
def test_verify_pswd_no_lower_char(self): assert not verify_pswd(pswd_generator(incl_lower_char=False))
def test_verify_pswd_various_invalid_char(self, invalid_char): assert not verify_pswd(pswd_generator(pswd_base=invalid_char))
def test_verify_pswd_not_enough_length(self, length): assert not verify_pswd(pswd_generator(length=length))
def test_change_pswd_over_valid_length(self): old_pswd = pswd_generator(length=MAX_VALID_LENGTH) new_pswd = pswd_changer(old_pswd) + 'A' assert not change_pswd(old_pswd, new_pswd)
def test_change_pswd_not_enough_length(self): old_pswd = pswd_generator() new_pswd = pswd_changer(old_pswd)[:-1] assert not change_pswd(old_pswd, new_pswd)
def test_change_pswd_valid_length_dissimilar(self, length, add_diff_ratio): old_pswd = pswd_generator(length=length) new_pswd = pswd_changer(old_pswd, diff_ratio=(1 - SIMILARITY_THRESHOLD + add_diff_ratio)) assert change_pswd(old_pswd, new_pswd)
def test_change_pswd_num_less_than_half_of_length_even(self, length): old_pswd = pswd_generator(pswd_base='!1', length=length, incl_sp_char=False) new_pswd = pswd_changer(old_pswd, diff_ratio=0.3) assert change_pswd(old_pswd, new_pswd)
def test_change_pswd_valid_continuous_same_char_num( self, continous_num): old_pswd = pswd_generator(pswd_base='a' * continous_num, length=100) new_pswd = pswd_changer(old_pswd) assert change_pswd(old_pswd, new_pswd)
def test_change_pswd_valid_length(self, length): old_pswd = pswd_generator(length=length) new_pswd = pswd_changer(old_pswd) assert change_pswd(old_pswd, new_pswd)
def test_verify_pswd_over_sp_char_num(self, sp_char_num): pswd = ''.join( [SP_CHARS[i % len(SP_CHARS)] for i in range(sp_char_num)]) assert not verify_pswd( pswd_generator(pswd_base=pswd, incl_sp_char=False))
def test_change_pswd_various_invalid_char(self, invalid_char): old_pswd = pswd_generator() new_pswd = pswd_changer(old_pswd)[:-1] + invalid_char assert not change_pswd(old_pswd, new_pswd)
def test_verify_pswd_not_enough_length_0(self, length): assert not verify_pswd( pswd_generator(length=length, incl_sp_char=False))
def test_change_pswd_no_special_char(self): old_pswd = pswd_generator() new_pswd = pswd_changer(pswd_generator(incl_sp_char=False)) assert not change_pswd(old_pswd, new_pswd)
def test_verify_pswd_over_valid_length(self, length): assert not verify_pswd(pswd_generator(length=length))
def test_change_pswd_no_lower_char(self): old_pswd = pswd_generator() new_pswd = pswd_generator(incl_lower_char=False) assert not change_pswd(old_pswd, new_pswd)
def test_verify_pswd_non_valid_special_char(self): assert not verify_pswd(pswd_generator(incl_sp_char=False))
def test_change_pswd_no_numeric_char(self): old_pswd = pswd_generator() new_pswd = pswd_generator(incl_num=False) assert not change_pswd(old_pswd, new_pswd)
def test_verify_pswd_no_numeric(self): assert not verify_pswd(pswd_generator(incl_num=False))
def test_change_pswd_over_continuous_same_char_num( self, continous_num): old_pswd = pswd_generator() new_pswd = pswd_generator(pswd_base='a' * continous_num) assert not change_pswd(old_pswd, new_pswd)
def test_verify_pswd_num_more_than_half_of_length_odd(self, length): assert not verify_pswd( pswd_generator( pswd_base='!123', length=length, incl_sp_char=False))
def test_change_pswd_over_sp_char_num(self, sp_char_num): old_pswd = pswd_generator() pswd = ''.join( [SP_CHARS[i % len(SP_CHARS)] for i in range(sp_char_num)]) new_pswd = pswd_generator(pswd_base=pswd, incl_sp_char=False) assert not change_pswd(old_pswd, new_pswd)