示例#1
0
文件: api.py 项目: vishnu-rai/OpenCue
def findLayer(job, layer):
    """Finds and returns a layer from the specified pending job.

    :type job: str
    :param job: the job name
    :type layer: str
    :param layer: the layer name
    :rtype: opencue.wrappers.layer.Layer
    :return: the layer matching the query"""
    return Layer(Cuebot.getStub('layer').FindLayer(
        job_pb2.LayerFindLayerRequest(job=job, layer=layer), timeout=Cuebot.Timeout).layer)
示例#2
0
    def testFindLayer(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.FindLayer.return_value = job_pb2.LayerFindLayerResponse(
            layer=job_pb2.Layer(name=TEST_LAYER_NAME))
        getStubMock.return_value = stubMock

        layer = opencue.api.findLayer(TEST_JOB_NAME, TEST_LAYER_NAME)

        stubMock.FindLayer.assert_called_with(
            job_pb2.LayerFindLayerRequest(job=TEST_JOB_NAME, layer=TEST_LAYER_NAME),
            timeout=mock.ANY)
        self.assertEqual(TEST_LAYER_NAME, layer.name())
示例#3
0
def findLayer(job, layer):
    """Finds and returns a layer from the specified pending job.
    @type job: str
    @param job: the job name
    @type layer: str
    @param layer: the layer name
    @rtype: Layer
    @return: the layer matching the query"""
    return Layer(
        Cuebot.getStub('layer').FindLayer(job_pb2.LayerFindLayerRequest(
            job=job, layer=layer),
                                          timeout=Cuebot.Timeout).layer)