def setUp(self): super(ApiCreateUserClientApprovalHandlerTest, self).setUp() self.client_id = self.SetupClients(1)[0] self.handler = user_plugin.ApiCreateUserClientApprovalHandler() self.args = user_plugin.ApiCreateUserClientApprovalArgs( client_id=self.client_id) self.args.approval.reason = self.token.reason self.args.approval.notified_users = ["approver"] self.args.approval.email_cc_addresses = ["*****@*****.**"] self.approval_urn = aff4.ROOT_URN.Add("ACL").Add(self.client_id.Basename( )).Add(self.token.username).Add(utils.EncodeReasonString(self.token.reason)) self.CreateUser("test") self.CreateUser("approver")
def CreateUserClientApproval(self, args, token=None): return api_user.ApiCreateUserClientApprovalHandler()