def test_simpleCanceller(self):
        def cancel(d):
            self.cancellerCallCount += 1

        d = defer.Deferred(canceller=cancel)
        d.addCallbacks(self._callback, self._errback)
        d.cancel()
        self.assertEquals(self.cancellerCallCount, 1)
        self.assertEquals(self.errbackResults.type, defer.CancelledError)

        # Test that further call/errbacks are *not* swallowed
        self.assertRaises(defer.AlreadyCalledError, d.callback, None)
        self.assertRaises(defer.AlreadyCalledError, d.errback, Exception())
Verify that a L{defer.Deferred} calls its specified canceller when
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_defer.py/DeferredCancellerTest.test_simpleCanceller