def createDependencyOnFrame(self, frame): """Create and return a layer on frame dependency @type frame: Frame @param frame: the frame you want this layer to depend on @rtype: opencue.depend.Depend @return: the new dependency""" response = self.stub.CreateDependOnFrame( job_pb2.LayerCreateDependOnFrameRequest(layer=self.data, frame=frame), timeout=Cuebot.Timeout) return opencue.wrappers.depend.Depend(response.depend)
def createDependencyOnFrame(self, frame): """Creates and returns a layer-on-frame dependency. :type frame: opencue.wrappers.frame.Frame :param frame: the frame you want this layer to depend on :rtype: opencue.wrappers.depend.Depend :return: the new dependency """ response = self.stub.CreateDependencyOnFrame( job_pb2.LayerCreateDependOnFrameRequest(layer=self.data, frame=frame.data), timeout=Cuebot.Timeout) return opencue.wrappers.depend.Depend(response.depend)
def testCreateDependencyOnFrame(self, getStubMock): dependId = 'dddd-ddd-dddd' frameId = 'ffff-fff-ffff' stubMock = mock.Mock() stubMock.CreateDependOnFrame.return_value = job_pb2.LayerCreateDependOnFrameResponse( depend=depend_pb2.Depend(id=dependId)) getStubMock.return_value = stubMock layer = opencue.wrappers.layer.Layer( job_pb2.Layer(name=TEST_LAYER_NAME)) frame = job_pb2.Frame(id=frameId) depend = layer.createDependencyOnFrame(frame) stubMock.CreateDependOnFrame.assert_called_with( job_pb2.LayerCreateDependOnFrameRequest(layer=layer.data, frame=frame), timeout=mock.ANY) self.assertEqual(depend.id(), dependId)