def createDependencyOnFrame(self, frame): """Create and return a job on frame dependency @type frame: opencue.wrappers.frame.Frame @param frame: the frame you want this job to depend on @rtype: opencue.wrappers.depend.Depend @return: the new dependency""" response = self.stub.CreateDependencyOnFrame( job_pb2.JobCreateDependencyOnFrameRequest(job=self.data, frame=frame.data), timeout=Cuebot.Timeout) return opencue.wrappers.depend.Depend(response.depend)
def testCreateDependencyOnFrame(self, getStubMock): dependId = 'ddd-dddd-ddd' dependFrame = 'testFrame' stubMock = mock.Mock() stubMock.CreateDependencyOnFrame.return_value = job_pb2.JobCreateDependencyOnFrameResponse( depend=depend_pb2.Depend(id=dependId)) getStubMock.return_value = stubMock onFrame = job_pb2.Frame(name=dependFrame) job = opencue.wrappers.job.Job( job_pb2.Job(name=TEST_JOB_NAME)) depend = job.createDependencyOnFrame(onFrame) stubMock.CreateDependencyOnFrame.assert_called_with( job_pb2.JobCreateDependencyOnFrameRequest(job=job.data, frame=onFrame), timeout=mock.ANY) self.assertEqual(depend.id(), dependId)