'If a cancellation function is provided when the L{defer.Deferred} is
initialized, the L{defer.Deferred} returns the cancellation value\'s
non-failure return value when the L{defer.Deferred} times out.'

def test_timedOutProvidedCancelSuccess(self):

    clock = Clock()
    d = defer.Deferred((lambda c: c.callback('I    was    cancelled!')))
    d.addTimeout(10, clock)
    self.assertNoResult(d)
    clock.advance(15)
    self.assertEqual(self.successResultOf(d), 'I    was    cancelled!')
