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

def test_timedOutProvidedCancelFailure(self):

    clock = Clock()
    error = ValueError('what!')
    d = defer.Deferred((lambda c: c.errback(error)))
    d.addTimeout(10, clock)
    self.assertNoResult(d)
    clock.advance(15)
    f = self.failureResultOf(d, ValueError)
    self.assertIs(f.value, error)
