Esempio n. 1
0
 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)
Esempio n. 2
0
 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)