示例#1
0
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)
示例#2
0
文件: api.py 项目: vishnu-rai/OpenCue
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)
示例#3
0
    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())