def getFrame(uniq): """Returns a Frame object from the unique id. @type uniq: a unique identifier. @param uniq: id @rtype: Frame @return: A Frame object""" return Frame( Cuebot.getStub('frame').GetFrame(job_pb2.FrameGetFrameRequest(id=uniq), timeout=Cuebot.Timeout).frame)
def getFrame(uniq): """Returns a Frame object from the unique ID. :type uniq: str :param uniq: a unique frame identifier :rtype: opencue.wrappers.frame.Frame :return: a Frame object""" return Frame( Cuebot.getStub('frame').GetFrame(job_pb2.FrameGetFrameRequest(id=uniq), timeout=Cuebot.Timeout).frame)
def testGetFrame(self, getStubMock): arbitraryId = '00000000-0000-0000-0000-012345678980' stubMock = mock.Mock() stubMock.GetFrame.return_value = job_pb2.FrameGetFrameResponse( frame=job_pb2.Frame(id=arbitraryId)) getStubMock.return_value = stubMock frame = opencue.api.getFrame(arbitraryId) stubMock.GetFrame.assert_called_with( job_pb2.FrameGetFrameRequest(id=arbitraryId), timeout=mock.ANY) self.assertEqual(arbitraryId, frame.id())