Esempio n. 1
0
 def test_07_queue_consumer(self):
     q = QueueConsumer(QueueMock())
     
     # the QueueMock will return None 3 times before giving
     # an item, so this operation should take more than 1.5
     # seconds
     start = time.time()
     item = q.first()
     took = time.time() - start
     assert took > 1.25, took
     assert took < 2.0, took
Esempio n. 2
0
 def test_08_stopped_queue(self):
     q = QueueConsumer(QueueMock())
     q.stop()
     item = q.first()
     assert item is None