On Sun, Nov 23, 2003 at 11:29:45PM -0300, RITA Y/O RODRIGO DIAZ Y/O BENENSON wrote:
Short question, which is the adecuate way of doing unit test of a sequence of defered events ? one chained to the other.
If each deferred need a callback method, I have already more that thirty functiones defined, and each time I need more.
How to do it ?
defered = something
<the magic>
defered = the_next_thing # that need the previous defered to have been acomplished
etc...
I can imagine various tricks, but I supose there is a standart way.
from twisted.trial import unittest result = unittest.deferredResult(theDeferred) "deferredResult" iterates the reactor until the given deferred has a result, then returns that result. See its sibling, deferredError, for testing of failure conditions. Jp