def test_raisesAfterCancelAndErrback(self):
        d = defer.Deferred()
        d.addCallbacks(self._callback, self._errback)
        d.cancel()

        # A single extra errback should be swallowed.
        d.errback(Exception())

        # But a second call to callback or errback is not.
        self.assertRaises(defer.AlreadyCalledError, d.callback, None)
        self.assertRaises(defer.AlreadyCalledError, d.errback, Exception())
Connects to Google Compute Engine with the given credentials.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_defer.py/DeferredCancellerTest.test_raisesAfterCancelAndErrback--crossover with--dataset/ETHPy150Open AppScale/appscale-tools/lib/agents/gce_agent.py/GCEAgent.open_connection