def getLayer(self): """Return the layer this proc is running. @rtype: Layer @return: The layer this proc is running.""" response = self.stub.GetLayer( host_pb2.ProcGetLayerRequest(proc=self.data), timeout=Cuebot.Timeout) return opencue.wrappers.layer.Layer(response.layer)
def testGetLayer(self, getStubMock): stubMock = mock.Mock() stubMock.GetLayer.return_value = host_pb2.ProcGetLayerResponse( layer=job_pb2.Layer(name=TEST_LAYER_NAME)) getStubMock.return_value = stubMock proc = opencue.wrappers.proc.Proc(host_pb2.Proc(name=TEST_PROC_NAME)) layer = proc.getLayer() stubMock.GetLayer.assert_called_with( host_pb2.ProcGetLayerRequest(proc=proc.data), timeout=mock.ANY) self.assertEqual(layer.name(), TEST_LAYER_NAME)