#NEWLINE# def testStopOutstanding( self ) : #NEWLINE# #INDENT# '\n        An iterator run with L{Cooperator.coiterate} paused on a L{Deferred}\n        yielded by that iterator will fire its own L{Deferred} (the one\n        returned by C{coiterate}) when L{Cooperator.stop} is called.\n        ' #NEWLINE# testControlD = defer . Deferred ( ) #NEWLINE# outstandingD = defer . Deferred ( ) #NEWLINE# def myiter( ) : #NEWLINE# #INDENT# reactor . callLater ( 0 , testControlD . callback , None ) #NEWLINE# ( yield outstandingD ) #NEWLINE# self . fail ( ) #NEWLINE# #UNINDENT# c = task . Cooperator ( ) #NEWLINE# d = c . coiterate ( myiter ( ) ) #NEWLINE# def stopAndGo( ign ) : #NEWLINE# #INDENT# c . stop ( ) #NEWLINE# outstandingD . callback ( 'arglebargle' ) #NEWLINE# #UNINDENT# testControlD . addCallback ( stopAndGo ) #NEWLINE# d . addCallback ( self . cbIter ) #NEWLINE# d . addErrback ( d . ebIter ) #NEWLINE# return d . addCallback ( ( lambda result : self . assertEqual ( result , self . RESULT ) ) )