Exemple #1
0
 def test_queued_reconnector(self):
     t1 = GoodEnoughTub()
     bill_connections = []
     barry_connections = []
     t1.connectTo(self.bill_url, bill_connections.append)
     t1.connectTo(self.barry_url, barry_connections.append)
     def _check():
         if len(bill_connections) >= 1 and len(barry_connections) >= 1:
             return True
         return False
     d = self.poll(_check)
     def _validate(res):
         self.failUnless(isinstance(bill_connections[0], RemoteReference))
         self.failUnless(isinstance(barry_connections[0], RemoteReference))
         self.failIf(bill_connections[0] == barry_connections[0])
     d.addCallback(_validate)
     self.services.append(t1)
     eventually(t1.startService)
     return d
Exemple #2
0
    def test_queued_reconnector(self):
        t1 = GoodEnoughTub()
        bill_connections = []
        barry_connections = []
        t1.connectTo(self.bill_url, bill_connections.append)
        t1.connectTo(self.barry_url, barry_connections.append)

        def _check():
            if len(bill_connections) >= 1 and len(barry_connections) >= 1:
                return True
            return False

        d = self.poll(_check)

        def _validate(res):
            self.failUnless(isinstance(bill_connections[0], RemoteReference))
            self.failUnless(isinstance(barry_connections[0], RemoteReference))
            self.failIf(bill_connections[0] == barry_connections[0])

        d.addCallback(_validate)
        self.services.append(t1)
        eventually(t1.startService)
        return d