Пример #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')
Пример #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
Пример #3
0
 def _genHandledTerminalAsyncFailure(self, d):
     x = waitForDeferred(d)
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Пример #4
0
 def _genHandledTerminalFailure(self):
     x = waitForDeferred(fail(TerminalException("Handled Terminal Failure")))
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Пример #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
Пример #6
0
 def _genHandledTerminalAsyncFailure(self, d):
     x = waitForDeferred(d)
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Пример #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
Пример #8
0
 def _genHandledTerminalFailure(self):
     x = waitForDeferred(fail(
         TerminalException("Handled Terminal Failure")))
     yield x
     try:
         x.getResult()
     except TerminalException:
         pass
Пример #9
0
 def _genBuggy(self):
     yield waitForDeferred(getThing())
     1/0
Пример #10
0
 def _genBuggy(self):
     yield waitForDeferred(getThing())
     1 / 0