Example #1
0
    def test_client_reconnect_failed(self):
        bridge = _DummyBridge()
        with constructAcceptor(self.log, False, bridge) as acceptor:
            client = SimpleClient(acceptor._host, acceptor._port, False,
                                  incoming_heartbeat=1000,
                                  outgoing_heartbeat=5000, nr_retries=1)

            # make sure client received CONNECTED frame
            time.sleep(2)
            acceptor.stop()
            time.sleep(2)
            with self.assertRaises(Disconnected):
                client.call(JsonRpcRequest("ping", [], CALL_ID),
                            timeout=CALL_TIMEOUT)
Example #2
0
    def test_client_reconnect_failed(self):
        bridge = _DummyBridge()
        with constructAcceptor(self.log, False, bridge) as acceptor:
            client = SimpleClient(acceptor._host,
                                  acceptor._port,
                                  False,
                                  incoming_heartbeat=1000,
                                  outgoing_heartbeat=5000,
                                  nr_retries=1)

            # make sure client received CONNECTED frame
            time.sleep(2)
            acceptor.stop()
            time.sleep(2)
            with self.assertRaises(Disconnected):
                client.call(JsonRpcRequest("ping", [], CALL_ID),
                            timeout=CALL_TIMEOUT)