Beispiel #1
0
 def getWhatThisDependsOn(self):
     """Returns a list of dependencies that this frame depends on
     @rtype:  list<Depend>
     @return: List of dependencies that this frame depends on"""
     response = self.stub.GetWhatThisDependsOn(
         job_pb2.FrameGetWhatThisDependsOnRequest(frame=self.data),
         timeout=Cuebot.Timeout)
     return [opencue.wrappers.depend.Depend(dep) for dep in response.depends.depends]
Beispiel #2
0
    def testGetWhatThisDependsOn(self, getStubMock):
        dependId = 'ddd-dddd-ddd'
        stubMock = mock.Mock()
        stubMock.GetWhatThisDependsOn.return_value = job_pb2.FrameGetWhatThisDependsOnResponse(
            depends=depend_pb2.DependSeq(depends=[depend_pb2.Depend(id=dependId)]))
        getStubMock.return_value = stubMock

        frame = opencue.wrappers.frame.Frame(
            job_pb2.Frame(name=TEST_FRAME_NAME, state=job_pb2.RUNNING))
        depends = frame.getWhatThisDependsOn()

        stubMock.GetWhatThisDependsOn.assert_called_with(
            job_pb2.FrameGetWhatThisDependsOnRequest(frame=frame.data), timeout=mock.ANY)
        self.assertEqual(len(depends), 1)
        self.assertEqual(depends[0].id(), dependId)