def testDeleteAlloc(self, getStubMock): allocToDelete = facility_pb2.Allocation(name=TEST_ALLOC_NAME) stubMock = mock.Mock() stubMock.Delete.return_value = facility_pb2.AllocDeleteResponse() getStubMock.return_value = stubMock opencue.api.deleteAllocation(allocToDelete) stubMock.Delete.assert_called_with( facility_pb2.AllocDeleteRequest(allocation=allocToDelete), timeout=mock.ANY)
def deleteAllocation(alloc): """Deletes an allocation. :type alloc: facility_pb2.Allocation :param alloc: allocation to delete :rtype: facility_pb2.AllocDeleteResponse :return: empty response""" return Cuebot.getStub('allocation').Delete( facility_pb2.AllocDeleteRequest(allocation=alloc), timeout=Cuebot.Timeout)
def testDelete(self, getStubMock): stubMock = mock.Mock() stubMock.Delete.return_value = facility_pb2.AllocDeleteResponse() getStubMock.return_value = stubMock alloc = opencue.wrappers.allocation.Allocation( facility_pb2.Allocation(name=TEST_ALLOC_NAME)) alloc.delete() stubMock.Delete.assert_called_with( facility_pb2.AllocDeleteRequest(allocation=alloc.data), timeout=mock.ANY)
def delete(self): """Deletes the allocation.""" self.stub.Delete(facility_pb2.AllocDeleteRequest(allocation=self.data), timeout=Cuebot.Timeout)
def delete(self): """Delete the record of the allocation from the cuebot""" self.stub.Delete( facility_pb2.AllocDeleteRequest(allocation=self.data), timeout=Cuebot.Timeout )
def deleteAllocation(alloc): return Cuebot.getStub('allocation').Delete( facility_pb2.AllocDeleteRequest(allocation=alloc), timeout=Cuebot.Timeout)