예제 #1
0
    def Run(self):
        with test_lib.FakeTime(42):
            with self.CreateHunt(description="the hunt") as hunt_obj:
                pass

        self.Check("GetHuntResultsExportCommand",
                   args=hunt_plugin.ApiGetHuntResultsExportCommandArgs(
                       hunt_id=hunt_obj.urn.Basename()),
                   replace={hunt_obj.urn.Basename()[2:]: "123456"})
예제 #2
0
    def Run(self):
        with test_lib.FakeTime(42):
            hunt_id = self.CreateHunt(description="the hunt")
            # TODO(user): replacement done for backwards compatibility with
            # the AFF4 implementation. Simply change to {hunt_id: "123456"} when
            # AFF4 is gone.
            replace = {hunt_id: "H:123456", "_%s" % hunt_id: "_H_123456"}

        self.Check("GetHuntResultsExportCommand",
                   args=hunt_plugin.ApiGetHuntResultsExportCommandArgs(
                       hunt_id=hunt_id),
                   replace=replace)
예제 #3
0
    def Run(self):
        with test_lib.FakeTime(42):
            if data_store.RelationalDBEnabled():
                hunt_id = self.CreateHunt(description="the hunt")
                # TODO(user): replacement done for backwards compatibility with
                # the AFF4 implementation. Simply change to {hunt_id: "123456"} when
                # AFF4 is gone.
                replace = {hunt_id: "H:123456", "_%s" % hunt_id: "_H_123456"}
            else:
                with self.CreateHunt(description="the hunt") as hunt_obj:
                    hunt_id = hunt_obj.urn.Basename()
                    replace = {hunt_id[2:]: "123456"}

        self.Check("GetHuntResultsExportCommand",
                   args=hunt_plugin.ApiGetHuntResultsExportCommandArgs(
                       hunt_id=hunt_id),
                   replace=replace)