def _genBasics(self): x = waitForDeferred(getThing()) yield x x = x.getResult() self.assertEquals(x, "hi") ow = waitForDeferred(getOwie()) yield ow try: ow.getResult() except ZeroDivisionError, e: self.assertEquals(str(e), 'OMG')
def _genStackUsage(self): for x in range(5000): # Test with yielding a deferred x = waitForDeferred(succeed(1)) yield x x = x.getResult() yield 0
def _genHandledTerminalAsyncFailure(self, d): x = waitForDeferred(d) yield x try: x.getResult() except TerminalException: pass
def _genHandledTerminalFailure(self): x = waitForDeferred(fail(TerminalException("Handled Terminal Failure"))) yield x try: x.getResult() except TerminalException: pass
def _genBasics(self): x = waitForDeferred(getThing()) yield x x = x.getResult() self.assertEquals(x, "hi") ow = waitForDeferred(getOwie()) yield ow try: ow.getResult() except ZeroDivisionError as e: self.assertEquals(str(e), 'OMG') yield "WOOSH" return
def _genHandledTerminalFailure(self): x = waitForDeferred(fail( TerminalException("Handled Terminal Failure"))) yield x try: x.getResult() except TerminalException: pass
def _genBuggy(self): yield waitForDeferred(getThing()) 1/0
def _genBuggy(self): yield waitForDeferred(getThing()) 1 / 0