'Let C{a} and C{b} be two L{Deferred}s.
If C{a} has no result and is returned from a callback on C{b} then when
C{a} fails, C{b}\'s result becomes the L{Failure} that was C{a}\'s result,
the result of C{a} becomes L{None} so that no unhandled error is logged
when it is garbage collected.'

def test_asynchronousImplicitErrorChain(self):

    first = defer.Deferred()
    second = defer.Deferred()
    second.addCallback((lambda ign: first))
    second.callback(None)
    secondError = []
    second.addErrback(secondError.append)
    firstResult = []
    first.addCallback(firstResult.append)
    secondResult = []
    second.addCallback(secondResult.append)
    self.assertEqual(firstResult, [])
    self.assertEqual(secondResult, [])
    first.errback(RuntimeError("First    Deferred's    Failure"))
    self.assertTrue(secondError[0].check(RuntimeError))
    self.assertEqual(firstResult, [None])
    self.assertEqual(len(secondResult), 1)
