def getLayer(uniq): """Returns a Layer object for the given layer ID. @type uniq: str @param uniq: a unique layer identifier @rtype: Layer @return: a Layer object""" return Layer( Cuebot.getStub('layer').GetLayer(job_pb2.LayerGetLayerRequest(id=uniq), timeout=Cuebot.Timeout).layer)
def getLayer(uniq): """Returns a Layer object for the given layer ID. :type uniq: str :param uniq: a unique layer identifier :rtype: opencue.wrappers.layer.Layer :return: a Layer object""" return Layer(Cuebot.getStub('layer').GetLayer( job_pb2.LayerGetLayerRequest(id=uniq), timeout=Cuebot.Timeout).layer)
def testGetLayer(self, getStubMock): arbitraryId = '00000000-0000-0000-0000-012345678980' stubMock = mock.Mock() stubMock.GetLayer.return_value = job_pb2.LayerGetLayerResponse( layer=job_pb2.Layer(id=arbitraryId)) getStubMock.return_value = stubMock layer = opencue.api.getLayer(arbitraryId) stubMock.GetLayer.assert_called_with( job_pb2.LayerGetLayerRequest(id=arbitraryId), timeout=mock.ANY) self.assertEqual(arbitraryId, layer.id())