Ejemplo n.º 1
0
    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')
Ejemplo n.º 2
0
 def _genStackUsage(self):
     for x in range(5000):
         # Test with yielding a deferred
         x = waitForDeferred(succeed(1))
         yield x
         x = x.getResult()
     yield 0
Ejemplo n.º 3
0
 def _genHandledTerminalAsyncFailure(self, d):
     x = waitForDeferred(d)
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Ejemplo n.º 4
0
 def _genHandledTerminalFailure(self):
     x = waitForDeferred(fail(TerminalException("Handled Terminal Failure")))
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Ejemplo n.º 5
0
 def _genStackUsage(self):
     for x in range(5000):
         # Test with yielding a deferred
         x = waitForDeferred(succeed(1))
         yield x
         x = x.getResult()
     yield 0
Ejemplo n.º 6
0
 def _genHandledTerminalAsyncFailure(self, d):
     x = waitForDeferred(d)
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Ejemplo n.º 7
0
    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
Ejemplo n.º 8
0
 def _genHandledTerminalFailure(self):
     x = waitForDeferred(fail(
         TerminalException("Handled Terminal Failure")))
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Ejemplo n.º 9
0
 def _genBuggy(self):
     yield waitForDeferred(getThing())
     1/0
Ejemplo n.º 10
0
 def _genBuggy(self):
     yield waitForDeferred(getThing())
     1 / 0