def testRendersRequestedHuntAppoval(self): with implementation.GRRHunt.StartHunt( hunt_name=standard.SampleHunt.__name__, token=self.token) as hunt: pass self.RequestHuntApproval(hunt.urn.Basename(), reason=self.token.reason, approver="approver", requestor=self.token.username) args = user_plugin.ApiListHuntApprovalsArgs() result = self.handler.Handle(args, token=self.token) self.assertEqual(len(result.items), 1)
def ListHuntApprovals(self, requestor=None): requestor = requestor or self.token.username handler = api_user.ApiListHuntApprovalsHandler() return handler.Handle( api_user.ApiListHuntApprovalsArgs(), token=access_control.ACLToken(username=requestor)).items