'A callback added to a L{Deferred} by a callback on that L{Deferred}
should be added to the end of the callback chain.'

def test_reentrantRunCallbacks(self):

    deferred = defer.Deferred()
    called = []
    def callback3(result):
        called.append(3)
    def callback2(result):
        called.append(2)
    def callback1(result):
        called.append(1)
        deferred.addCallback(callback3)
    deferred.addCallback(callback1)
    deferred.addCallback(callback2)
    deferred.callback(None)
    self.assertEqual(called, [1, 2, 3])
