~divmod-dev/divmod.org/compare-simpleordering-2839-2

« back to all changes in this revision

Viewing changes to Vertex/vertex/test/test_q2q.py

  • Committer: exarkun
  • Date: 2009-05-22 13:21:37 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:17315
Merge redundant-things-2865

Author: exarkun
Reviewer: mithrandi
Fixes: #2865, #2866

Remove the old implementation of Cooperator from Epsilon and base the remaining APIs
on the Cooperator implementation in Twisted.

Also remove a couple of deferLater implementations and replace them with uses of the
deferLater now in Twisted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
from twisted.trial import unittest
11
11
from twisted.application import service
12
12
from twisted.internet import reactor, protocol, defer
 
13
from twisted.internet.task import deferLater
13
14
from twisted.internet.ssl import DistinguishedName, PrivateCertificate, KeyPair
14
15
from twisted.protocols import basic
15
16
from twisted.python import log
504
505
                liveConnection.transport.pauseProducing()
505
506
            wfc = self.dataEater.waitForCount(SIZE * 2)
506
507
            resumed = [False]
507
 
            def deferLater(n, result=None):
508
 
                d = defer.Deferred()
509
 
                reactor.callLater(n, d.callback, result)
510
 
                return d
511
508
            def shouldntHappen(x):
512
509
                if resumed[0]:
513
510
                    return x
522
519
                    self.failUnless(self.streamer.pauseCount > 0)
523
520
                    self.failUnless(self.streamer.resumeCount > 0)
524
521
                return self.dataEater.waitForCount(SIZE * 2).addCallback(assertSomeStuff)
525
 
            return deferLater(3).addCallback(keepGoing)
 
522
            return deferLater(reactor, 3, lambda: None).addCallback(keepGoing)
526
523
        return defer.DeferredList([a, b]).addCallback(dotest)
527
524
 
528
525