def testFindFrame(self, getStubMock): frameNum = 4 stubMock = mock.Mock() stubMock.FindFrame.return_value = job_pb2.FrameFindFrameResponse( frame=job_pb2.Frame(layer_name=TEST_LAYER_NAME, number=frameNum)) getStubMock.return_value = stubMock frame = opencue.api.findFrame(TEST_JOB_NAME, TEST_LAYER_NAME, frameNum) stubMock.FindFrame.assert_called_with( job_pb2.FrameFindFrameRequest(job=TEST_JOB_NAME, layer=TEST_LAYER_NAME, frame=frameNum), timeout=mock.ANY) self.assertEqual(TEST_LAYER_NAME, frame.layer()) self.assertEqual(frameNum, frame.number())
def findFrame(job, layer, number): """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 @type number: int @param number: the frame number @rtype: Frame @return: the frame matching the query""" return Frame( Cuebot.getStub('frame').FindFrame(job_pb2.FrameFindFrameRequest( job=job, layer=layer, frame=number), timeout=Cuebot.Timeout).frame)