def ztest_delete_item(self): """ delete item """ queue = NMSQueue() result_set = queue.get_items_with_priority(1,1,0,1) the_item = None for item in result_set: print("\nItem = %s\n" % (item) ) the_item = item print("\nItem with uuid %s deleted" % (item.uuid) ) queue.delete_item(the_item.uuid)
def ztest_delete_from_uuid(self): """ test get from uuid """ queue = NMSQueue() item = NMSQueueItem(5,"data %s" % (1)) item.set_uuid() print("item = %s\n" %(item)) queue.put(item) newitem = queue.get_item(item.uuid) print("new item = %s\n" % (newitem) ) queue.delete_item(item.uuid) newitem = queue.get_item(item.uuid) print("new item = %s\n" % (newitem) )