'L{defer.Deferred.fromFuture} makes a L{defer.Deferred} fire with
an L{asyncio.CancelledError} when the given
L{asyncio.Future} is cancelled.'

def test_fromFutureFutureCancelled(self):

    loop = new_event_loop()
    cancelled = Future(loop=loop)
    d = defer.Deferred.fromFuture(cancelled)
    cancelled.cancel()
    callAllSoonCalls(loop)
    self.assertRaises(CancelledError, cancelled.result)
    self.failureResultOf(d).trap(CancelledError)
