'L{defer.Deferred.fromFuture} makes a L{defer.Deferred} which, when
cancelled, cancels the L{asyncio.Future} it was created from.'

def test_fromFutureDeferredCancelled(self):

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