'While Futures don\'t support succeeding in response to cancellation,
Deferreds do; if a Deferred is coerced into a success by a Future
cancellation, that should just be ignored.'

def test_asFutureSuccessCancel(self):

    def canceler(dprime):
        dprime.callback(9)
    d = defer.Deferred(canceler)
    loop = new_event_loop()
    aFuture = d.asFuture(loop)
    aFuture.cancel()
    callAllSoonCalls(loop)
    self.assertEqual(self.successResultOf(d), None)
    self.assertRaises(CancelledError, aFuture.result)
