'Given three Deferreds, one chained to the next chained to the next,
callbacks on the middle Deferred which are added after the chain is
created are called once the last Deferred fires.
This is more of a regression-style test.  It doesn\'t exercise any
particular code path through the current implementation of Deferred, but
it does exercise a broken codepath through one of the variations of the
implementation proposed as a resolution to ticket #411.'

def test_resultOfDeferredResultOfDeferredOfFiredDeferredCalled(self):

    first = defer.Deferred()
    second = defer.Deferred()
    third = defer.Deferred()
    first.addCallback((lambda ignored: second))
    second.addCallback((lambda ignored: third))
    second.callback(None)
    first.callback(None)
    third.callback(None)
    L = []
    second.addCallback(L.append)
    self.assertEqual(L, [None])
