示例#1
0
    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
示例#2
0
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
示例#3
0
    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