'L{ThreadPool.callInThreadWithCallback} calls C{onResult} with a
two-tuple of C{(True, result)} where C{result} is the value returned
by the callable supplied.'

def test_callInThreadWithCallback(self):

    waiter = threading.Lock()
    waiter.acquire()
    results = []
    def onResult(success, result):
        waiter.release()
        results.append(success)
        results.append(result)
    tp = threadpool.ThreadPool(0, 1)
    tp.callInThreadWithCallback(onResult, (lambda : 'test'))
    tp.start()
    try:
        self._waitForLock(waiter)
    finally:
        tp.stop()
    self.assertTrue(results[0])
    self.assertEqual(results[1], 'test')
