mcroydon@1: """ mcroydon@1: Test basic queue functionality mcroydon@1: mcroydon@1: >>> from queues import queues mcroydon@1: >>> import datetime mcroydon@1: >>> queue_name = 'test_queues_%s' % datetime.datetime.now().isoformat() mcroydon@1: mcroydon@1: Verify that the queue does not exist mcroydon@1: >>> queue_name in queues.get_list() mcroydon@1: False mcroydon@1: mcroydon@1: Create the queue mcroydon@1: >>> q = queues.Queue(queue_name) mcroydon@1: mcroydon@1: Write to the queue mcroydon@1: >>> q.write('test') mcroydon@1: True mcroydon@1: mcroydon@1: Verify that it is indeed in the list mcroydon@1: >>> queue_name in queues.get_list() mcroydon@1: True mcroydon@1: mcroydon@1: Get the length of the queue mcroydon@1: >>> len(q) mcroydon@1: 1 mcroydon@1: mcroydon@1: Read from the queue mcroydon@1: >>> q.read() mcroydon@1: 'test' mcroydon@1: mcroydon@1: The queue should now be empty mcroydon@1: >>> len(q) mcroydon@1: 0 mcroydon@1: mcroydon@1: TODO: get rid of the queue? mcroydon@1: """ mcroydon@1: mcroydon@1: if __name__ == "__main__": mcroydon@1: import doctest mcroydon@1: doctest.testmod()