def createDependencyOnFrame(self, frame): """Create and return a frame on frame dependency @type frame: Frame @param frame: the frame you want this frame to depend on @rtype: Depend @return: The new dependency""" response = self.stub.CreateDependencyOnFrame( job_pb2.FrameCreateDependencyOnFrameRequest(frame=self.data, depend_on_frame=frame), timeout=Cuebot.Timeout) return opencue.wrappers.depend.Depend(response.depend)
def createDependencyOnFrame(self, frame): """Creates and returns a frame-on-frame dependency. :type frame: opencue.wrappers.frame.Frame :param frame: the frame you want this frame to depend on :rtype: opencue.wrappers.depend.Depend :return: the new dependency """ response = self.stub.CreateDependencyOnFrame( job_pb2.FrameCreateDependencyOnFrameRequest( frame=self.data, depend_on_frame=frame.data), timeout=Cuebot.Timeout) return opencue.wrappers.depend.Depend(response.depend)
def testCreateDependencyOnFrame(self, getStubMock): dependId = 'ddd-dddd-ddd' stubMock = mock.Mock() stubMock.CreateDependencyOnFrame.return_value = \ job_pb2.FrameCreateDependencyOnFrameResponse(depend=depend_pb2.Depend(id=dependId)) getStubMock.return_value = stubMock dependFrameName = 'frameDependTest' frame = opencue.wrappers.frame.Frame( job_pb2.Frame(name=TEST_FRAME_NAME)) dependOnFrame = job_pb2.Frame(name=dependFrameName) depend = frame.createDependencyOnFrame(dependOnFrame) stubMock.CreateDependencyOnFrame.assert_called_with( job_pb2.FrameCreateDependencyOnFrameRequest( frame=frame.data, depend_on_frame=dependOnFrame), timeout=mock.ANY) self.assertEqual(depend.id(), dependId)