Ticket #2876: 2876.diff

File 2876.diff, 1.5 KB (added by therve, 9 years ago)
  • twisted/test/test_pb.py

     
    11321132            def clientConnectionLost(self, connector, reason):
    11331133                reconnecting = not self.reconnectedAlready
    11341134                self.reconnectedAlready = True
    1135                 connector.connect()
     1135                if reconnecting:
     1136                    connector.connect()
    11361137                return pb.PBClientFactory.clientConnectionLost(
    11371138                    self, connector, reason, reconnecting)
    11381139
    11391140        factory, rootObjDeferred = self.getFactoryAndRootObject(ReconnectOnce)
    11401141
    11411142        def gotRootObject(rootObj):
    1142             self.failUnless(
    1143                 isinstance(rootObj, pb.RemoteReference),
    1144                 "%r is not a RemoteReference" % (rootObj,))
     1143            self.assertIsInstance(rootObj, pb.RemoteReference)
    11451144
    11461145            d = defer.Deferred()
    11471146            rootObj.notifyOnDisconnect(d.callback)
     
    11511150                d = factory.getRootObject()
    11521151
    11531152                def gotAnotherRootObject(anotherRootObj):
    1154                     self.failUnless(
    1155                         isinstance(rootObj, pb.RemoteReference),
    1156                         "%r is not a RemoteReference" % (rootObj,))
     1153                    self.assertIsInstance(anotherRootObj, pb.RemoteReference)
    11571154
    11581155                    d = defer.Deferred()
    11591156                    anotherRootObj.notifyOnDisconnect(d.callback)