def getWhatDependsOnThis(self): """Returns a list of dependencies that depend directly on this frame @rtype: list<Depend> @return: List of dependencies that depend directly on this frame""" response = self.stub.GetWhatDependsOnThis( job_pb2.FrameGetWhatDependsOnThisRequest(frame=self.data), timeout=Cuebot.Timeout) return [opencue.wrappers.depend.Depend(dep) for dep in response.depends.depends]
def testGetWhatDependsOnThis(self, getStubMock): dependId = 'ddd-dddd-ddd' stubMock = mock.Mock() stubMock.GetWhatDependsOnThis.return_value = job_pb2.FrameGetWhatDependsOnThisResponse( 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.getWhatDependsOnThis() stubMock.GetWhatDependsOnThis.assert_called_with( job_pb2.FrameGetWhatDependsOnThisRequest(frame=frame.data), timeout=mock.ANY) self.assertEqual(len(depends), 1) self.assertEqual(depends[0].id(), dependId)