def test_compare_password(self): """ test the new compare passwords - used in the pw and lost token """ # init the SecretObject sec_obj = SecretObj(val=libcrypt_password('password'), iv=':1:') # run the comparison tests - positive test res = sec_obj.compare_password('password') self.assertTrue(res) # negative test res = sec_obj.compare_password('Password') self.assertFalse(res) return
def test_compare_password(): """ test to verify the new password comparison in secret object used in the pw and lost token. """ # init the SecretObject enc_password = utils.crypt_password('password').encode('utf-8') sec_obj = SecretObj(val=enc_password, iv=b':1:') # run the comparison tests - positive test res = sec_obj.compare_password('password') assert res # negative test res = sec_obj.compare_password('Password') assert not res
def test_compare_password(self): """ test the new compare passwords - used in the pw and lost token """ # init the SecretObject sec_obj = SecretObj(val=libcrypt_password('password'), iv=':1:') # run the comparison tests - positive test res = sec_obj.compare_password('password') self.assertTrue(res) # negative test res = sec_obj.compare_password('Password') self.assertFalse(res) return