def runFilterOnJobs(self, jobs): """Runs the filter on the list of jobs provided @type jobs: list<JobInterfacePrx or Job or id or str jobname> @param jobs: The jobs to add to this group""" jobSeq = job_pb2.JobSeq(jobs=jobs) self.stub.RunFilterOnJobs(filter_pb2.FilterRunFilterOnJobsRequest( filter=self.data, jobs=jobSeq), timeout=Cuebot.Timeout)
def runFilterOnJobs(self, jobs): """Runs the filter on the list of jobs provided @type jobs: list<opencue.wrapper.job.Job> @param jobs: The jobs to run the filter on""" jobSeq = job_pb2.JobSeq(jobs=[job.data for job in jobs]) self.stub.RunFilterOnJobs(filter_pb2.FilterRunFilterOnJobsRequest( filter=self.data, jobs=jobSeq), timeout=Cuebot.Timeout)
def testRunFilterOnJobs(self, getStubMock): stubMock = mock.Mock() stubMock.RunFilterOnJobs.return_value = filter_pb2.FilterRunFilterOnJobsResponse() getStubMock.return_value = stubMock jobs = [opencue.wrappers.job.Job(job_pb2.Job(name='testJob'))] jobSeq = job_pb2.JobSeq(jobs=[job.data for job in jobs]) filterToRun = opencue.wrappers.filter.Filter(filter_pb2.Filter(name=TEST_FILTER_NAME)) filterToRun.runFilterOnJobs(jobs) stubMock.RunFilterOnJobs.assert_called_with( filter_pb2.FilterRunFilterOnJobsRequest(filter=filterToRun.data, jobs=jobSeq), timeout=mock.ANY)