'If a custom C{onTimeoutCancel] function is provided, the
L{defer.Deferred} returns the custom function\'s return value if the
L{defer.Deferred} times out before callbacking or errbacking.
The custom C{onTimeoutCancel} function can return a result instead of
a failure.'

def test_timedOutCustom(self):

    clock = Clock()
    d = defer.Deferred()
    d.addTimeout(10, clock, onTimeoutCancel=_overrideFunc)
    self.assertNoResult(d)
    clock.advance(15)
    self.assertEqual('OVERRIDDEN', self.successResultOf(d))
