'The L{defer.Deferred} callbacks with the result if it succeeds before
the timeout. No cancellation happens after the callback either,
which could also cancel inner deferreds.'

def test_successResultBeforeTimeout(self):

    clock = Clock()
    d = defer.Deferred()
    d.addTimeout(10, clock)
    innerDeferred = defer.Deferred()
    dCallbacked = [None]
    def onCallback(results):
        dCallbacked[0] = results
        return innerDeferred
    d.addCallback(onCallback)
    d.callback('results')
    self.assertIsNot(None, dCallbacked[0])
    self.assertEqual(dCallbacked[0], 'results')
    clock.advance(15)
    self.assertNoResult(innerDeferred)
