'L{threads.callMultipleInThread} calls multiple functions in a thread.'

def test_callMultiple(self):

    L = []
    N = 10
    d = defer.Deferred()
    def finished():
        self.assertEqual(L, list(range(N)))
        d.callback(None)
    threads.callMultipleInThread(([(L.append, (i,), {}) for i in range(N)] + [(reactor.callFromThread, (finished,), {})]))
    return d
