def setTag(self, tag): """Sets a new tag for the allocation. @type name: str @param name: the new tag """ self.stub.SetTag(facility_pb2.AllocSetTagRequest(allocation=self.data, tag=tag), timeout=Cuebot.Timeout)
def testAllocSetTag(self, getStubMock): alloc = facility_pb2.Allocation(name=TEST_ALLOC_NAME) newTag = 'arbitrary-tag' stubMock = mock.Mock() stubMock.SetTag.return_value = facility_pb2.AllocSetTagResponse() getStubMock.return_value = stubMock opencue.api.allocSetTag(alloc, newTag) stubMock.SetTag.assert_called_with( facility_pb2.AllocSetTagRequest(allocation=alloc, tag=newTag), timeout=mock.ANY)
def setTag(self, getStubMock): stubMock = mock.Mock() stubMock.SetTag.return_value = facility_pb2.AllocSetTagResponse() getStubMock.return_value = stubMock alloc = opencue.wrappers.allocation.Allocation(facility_pb2.Allocation()) alloc.setTag(TEST_ALLOC_TAG) stubMock.SetTag.assert_called_with( facility_pb2.AllocSetTagRequest(allocation=alloc.data, tag=TEST_ALLOC_TAG), timeout=mock.ANY)
def allocSetTag(alloc, tag): """Sets an allocation tag. :type alloc: facility_pb2.Allocation :param alloc: allocation to tag :type tag: str :param tag: new tag :rtype: facility_pb2.AllocSetTagResponse :return: empty response""" return Cuebot.getStub('allocation').SetTag(facility_pb2.AllocSetTagRequest( allocation=alloc, tag=tag), timeout=Cuebot.Timeout)
def allocSetTag(alloc, tag): return Cuebot.getStub('allocation').SetTag(facility_pb2.AllocSetTagRequest( allocation=alloc, tag=tag), timeout=Cuebot.Timeout)