コード例 #1
0
 def done(result):
     client.pending_tests -= 1
     client.recv_ok += 1
     if client.pending_tests == 0:
         client.test_done("ok")
     elif (client.recv_ok % 2) == 0:
         # keep sending messages for a while
         send_message()
コード例 #2
0
 def done(result):
     client.pending_tests -= 1
     client.recv_ok += 1
     if client.pending_tests == 0:
         client.test_done("ok")
     elif (client.recv_ok % 2) == 0:
         # keep sending messages for a while
         send_message()
コード例 #3
0
        def dummy(client):
            orig_connectionLost = self.protocols[0].peer.connectionLost

            def connectionLost(reason):
                """Catch disconnect and force a ConnectionLost."""
                orig_connectionLost(failure.Failure(txerror.ConnectionDone()))
                d.callback(None)

            self.patch(self.protocols[0].peer, 'connectionLost',
                       connectionLost)
            self.service.factory.protocols[0].shutdown()
            client.test_done('ok')
コード例 #4
0
        def dummy(client):
            # patch ProxyServer.connectionLost
            orig_connectionLost = self.protocols[0].connectionLost

            def connectionLost(reason):
                """Catch disconnect and force a ConnectionLost."""
                orig_connectionLost(txerror.ConnectionLost())
                d.callback(None)

            self.patch(self.protocols[0], 'connectionLost', connectionLost)
            client.kill()  # kill the client and trigger a connection lost
            client.test_done('ok')
コード例 #5
0
        def dummy(client):
            orig_connectionLost = self.protocols[0].peer.connectionLost

            def connectionLost(reason):
                """Catch disconnect and force a ConnectionLost."""
                orig_connectionLost(failure.Failure(txerror.ConnectionDone()))
                d.callback(None)

            self.patch(
                self.protocols[0].peer, 'connectionLost', connectionLost)
            self.service.factory.protocols[0].shutdown()
            client.test_done('ok')
コード例 #6
0
        def dummy(client):
            # patch ProxyServer.connectionLost
            orig_connectionLost = self.protocols[0].connectionLost

            def connectionLost(reason):
                """Catch disconnect and force a ConnectionLost."""
                orig_connectionLost(txerror.ConnectionLost())
                d.callback(None)

            self.patch(self.protocols[0], 'connectionLost', connectionLost)
            client.kill()  # kill the client and trigger a connection lost
            client.test_done('ok')
コード例 #7
0
 def dummy(client):
     client.test_done("ok")
コード例 #8
0
 def my_connection_lost(reason=None):
     """ check if we received a ping and finish the test. """
     client.__class__.connectionLost(client, reason)
     self.assertEquals(getattr(self._state, 'pings', 0), 1)
     client.test_done('ok')
コード例 #9
0
 def done(result):
     client.test_done("ok")
コード例 #10
0
 def done(result):
     self.assert_(result.rtt < 2)
     client.test_done("ok")
コード例 #11
0
 def dummy(client):
     client.test_done("ok")
コード例 #12
0
 def my_connection_lost(reason=None):
     """ check if we received a ping and finish the test. """
     client.__class__.connectionLost(client, reason)
     self.assertEqual(getattr(self._state, 'pings', 0), 1)
     client.test_done('ok')
コード例 #13
0
 def done(result):
     client.test_done("ok")
コード例 #14
0
 def done(result):
     self.assert_(result.rtt < 2)
     client.test_done("ok")
コード例 #15
0
 def dummy(client):
     client.test_done('ok')
コード例 #16
0
 def dummy(client):
     client.test_done('ok')