def test_callbackResultChangesValue(self): """ The result of a callback affects the result returned from C{synchronize}. """ sd = SynchronousDeferred("foo") sd.addCallback(lambda r: 42) self.assertEquals(sd.synchronize(), 42)
def test_errbackResultChangesValue(self): """ The result of an errback affects the result returned from C{synchronize}. """ sd = SynchronousDeferred(SynchronousFailure(RuntimeError())) sd.addErrback(lambda r: 42) self.assertEquals(sd.synchronize(), 42)