

def test_wait_ready_noneready(self):
    queue = Queue(self.store, self.relay)
    queue._add_queued((20, '1234'))
    queue.wake.clear()

    def wait_func():
        queue._wait_ready(10)
    thread = gevent.spawn(wait_func)
    gevent.sleep(0)
    self.assertFalse(thread.ready())
    queue._add_queued((5, '5678'))
    gevent.sleep(0)
    self.assertTrue(thread.ready())

dataset/ETHPy150Open slimta/python-slimta/test/test_slimta_queue.py TestQueue.test_wait_ready_noneready/original