'When a paused Deferred with a result is returned from a callback on
another Deferred, the other Deferred is chained to the first and waits
for it to be unpaused.'

def test_chainedPausedDeferredWithResult(self):

    expected = object()
    paused = defer.Deferred()
    paused.callback(expected)
    paused.pause()
    chained = defer.Deferred()
    chained.addCallback((lambda ignored: paused))
    chained.callback(None)
    result = []
    chained.addCallback(result.append)
    self.assertEqual(result, [])
    paused.unpause()
    self.assertEqual(result, [expected])
