Beispiel #1
0
 def getWhatDependsOnThis(self):
     """Returns a list of dependencies that depend directly on this job
     @rtype:  list<Depend>
     @return: List of dependencies that depend directly on this job"""
     response = self.stub.GetWhatDependsOnThis(
         job_pb2.JobGetWhatDependsOnThisRequest(job=self.data),
         timeout=Cuebot.Timeout)
     dependSeq = response.depends
     return [depend.Depend(depend) for depend in dependSeq.depends]
Beispiel #2
0
    def getWhatDependsOnThis(self):
        """Returns a list of dependencies that depend directly on this job.

        :rtype:  list<opencue.wrappers.depend.Depend>
        :return: list of dependencies that depend directly on this job
        """
        response = self.stub.GetWhatDependsOnThis(
            job_pb2.JobGetWhatDependsOnThisRequest(job=self.data),
            timeout=Cuebot.Timeout)
        dependSeq = response.depends
        return [
            opencue.wrappers.depend.Depend(dep) for dep in dependSeq.depends
        ]
Beispiel #3
0
    def testGetWhatDependsOnThis(self, getStubMock):
        dependId = 'ddd-dddd-ddd'
        stubMock = mock.Mock()
        stubMock.GetWhatDependsOnThis.return_value = job_pb2.JobGetWhatDependsOnThisResponse(
            depends=depend_pb2.DependSeq(depends=[depend_pb2.Depend(id=dependId)]))
        getStubMock.return_value = stubMock

        job = opencue.wrappers.job.Job(
            job_pb2.Job(name=TEST_JOB_NAME))
        depends = job.getWhatDependsOnThis()

        stubMock.GetWhatDependsOnThis.assert_called_with(
            job_pb2.JobGetWhatDependsOnThisRequest(job=job.data), timeout=mock.ANY)
        self.assertEqual(len(depends), 1)
        self.assertEqual(depends[0].id(), dependId)