예제 #1
0
 def test_04_do_request_success(self):
     radiusmock.setdata(response=radiusmock.AccessAccept)
     set_privacyidea_config("radius.dictfile", DICT_FILE)
     db_token = Token.query.filter(Token.serial == self.serial1).first()
     token = RadiusTokenClass(db_token)
     otpcount = token.check_otp("123456")
     self.assertTrue(otpcount >= 0, otpcount)
 def test_04_do_request_success(self):
     radiusmock.setdata(success=True)
     set_privacyidea_config("radius.dictfile", DICT_FILE)
     db_token = Token.query.filter(Token.serial == self.serial1).first()
     token = RadiusTokenClass(db_token)
     otpcount = token.check_otp("123456")
     self.assertTrue(otpcount >= 0, otpcount)
예제 #3
0
 def test_05_do_request_fail(self):
     radiusmock.setdata(response=radiusmock.AccessReject)
     db_token = Token.query.filter(Token.serial == self.serial1).first()
     token = RadiusTokenClass(db_token)
     otpcount = token.check_otp("123456")
     self.assertTrue(otpcount == -1, otpcount)
 def test_05_do_request_fail(self):
     radiusmock.setdata(success=False)
     db_token = Token.query.filter(Token.serial == self.serial1).first()
     token = RadiusTokenClass(db_token)
     otpcount = token.check_otp("123456")
     self.assertTrue(otpcount == -1, otpcount)