Exemplo n.º 1
0
 def testNoneTokenIsNotValid(self):
     with self.assertRaises(access_control.UnauthorizedAccess):
         user_managers.ValidateToken(None, "aff4:/C.0000000000000001")
Exemplo n.º 2
0
 def testTokenWithoutUsernameIsNotValid(self):
     token = access_control.ACLToken(reason="For testing")
     with self.assertRaises(access_control.UnauthorizedAccess):
         user_managers.ValidateToken(token, "aff4:/C.0000000000000001")
Exemplo n.º 3
0
 def testTokenWithUsernameAndReasonIsValid(self):
     token = access_control.ACLToken(username="******", reason="For testing")
     user_managers.ValidateToken(token, "aff4:/C.0000000000000001")