Beispiel #1
0
 def getFrames(self, **options):
     """Returns the list of up to 1000 frames from within the job.
     frames = job.getFrames(show=["edu","beo"],user="******")
     frames = job.getFrames(show="edu",shot="bs.012")
     Allowed: offset, limit, states+, layers+. frameset, changedate
     @rtype:  list<Frame>
     @return: List of frames"""
     criteria = opencue.search.FrameSearch.criteriaFromOptions(**options)
     response = self.stub.GetFrames(job_pb2.JobGetFramesRequest(job=self.data, req=criteria),
                                    timeout=Cuebot.Timeout)
     frameSeq = response.frames
     return [opencue.wrappers.frame.Frame(frm) for frm in frameSeq.frames]
Beispiel #2
0
    def testGetFrames(self, getStubMock):
        frameNames = ['testFrameA', 'testFrameB']
        stubMock = mock.Mock()
        stubMock.GetFrames.return_value = job_pb2.JobGetFramesResponse(
            frames=job_pb2.FrameSeq(frames=[job_pb2.Frame(name=frameNames[0]),
                                            job_pb2.Frame(name=frameNames[1])]))
        getStubMock.return_value = stubMock

        frameRange = '1-10'
        criteria = opencue.search.FrameSearch.criteriaFromOptions(range=frameRange)
        job = opencue.wrappers.job.Job(
            job_pb2.Job(name=TEST_JOB_NAME))
        frames = job.getFrames(range=frameRange)

        stubMock.GetFrames.assert_called_with(
            job_pb2.JobGetFramesRequest(job=job.data, req=criteria), timeout=mock.ANY)
        self.assertTrue(len(frames), 2)
        self.assertTrue(frames[0].name(), frameNames[0])
        self.assertTrue(frames[1].name(), frameNames[1])