def test_power_outage_single_thread(self):
		q = PersistentQueueWithAcknowledgement("test_queue.fs")
		for i in xrange(10):
			q.put(BW(Something(i)))

		myset = set()

		while not q.empty():
			i = q.get()
			myset.add(i)

		# Check that all elements are on the nonack queue and no elements is on the main queue
		self.assertTrue(len(q._queue.elements.items()) == 0)

		# Check that all elements are on the nonack set
		nonack_set = set()
		for item in q._nonack_queue.keys():
			nonack_set.add(item)

		self.assertEqual(myset, nonack_set)

		q._destructor = self.dummy_destructor

		q.connection.close()
		q.db.close()
		q.storage.close()
#		q._dump()
		del q

		# Check that all elements are on the queue again and nothing in the nonack set
		q = PersistentQueueWithAcknowledgement("test_queue.fs")
		self.assertTrue(len(q._queue.elements.items()) == 10)
		self.assertTrue(len(q._nonack_queue.keys()) == 0)