def Run(self): # Check client_limit update. with test_lib.FakeTime(42): hunt = self.CreateHunt(description="the hunt") # Create replace dictionary. replace = {hunt.urn.Basename(): "H:123456"} with test_lib.FakeTime(43): self.Check("ModifyHunt", args=hunt_plugin.ApiModifyHuntArgs( hunt_id=hunt.urn.Basename(), client_limit=142), replace=replace) self.Check("ModifyHunt", args=hunt_plugin.ApiModifyHuntArgs( hunt_id=hunt.urn.Basename(), state="STOPPED"), replace=replace)
def setUp(self): super(ApiModifyHuntHandlerTest, self).setUp() self.handler = hunt_plugin.ApiModifyHuntHandler() self.hunt = self.CreateHunt(description="the hunt") self.hunt_urn = self.hunt.urn self.args = hunt_plugin.ApiModifyHuntArgs( hunt_id=self.hunt.urn.Basename())
def testModifyHuntIsAccessChecked(self): args = api_hunt.ApiModifyHuntArgs(hunt_id="H:123456") self.CheckMethodIsAccessChecked( self.router.ModifyHunt, "CheckHuntAccess", args=args)