예제 #1
0
    def test_set_heartbeat(self):
        client = AsyncClient(incoming_heartbeat=200, outgoing_heartbeat=100)
        client.handle_connect()

        req_frame = client.pop_message()

        self.assertEqual(req_frame.command, Command.CONNECT)
        self.assertEqual(req_frame.headers[Headers.ACCEPT_VERSION], '1.2')
        self.assertEqual(req_frame.headers[Headers.HEARTBEAT], '120,160')
예제 #2
0
    def test_set_heartbeat(self):
        client = AsyncClient(incoming_heartbeat=200, outgoing_heartbeat=100)
        client.handle_connect()

        req_frame = client.pop_message()

        self.assertEqual(req_frame.command, Command.CONNECT)
        self.assertEqual(req_frame.headers[Headers.ACCEPT_VERSION], '1.2')
        self.assertEqual(req_frame.headers[Headers.HEARTBEAT], '120,160')
예제 #3
0
    def test_connect(self):
        client = AsyncClient()
        client.handle_connect()

        req_frame = client.pop_message()

        self.assertEqual(req_frame.command, Command.CONNECT)
        self.assertEqual(req_frame.headers[Headers.ACCEPT_VERSION], '1.2')
        self.assertEqual(req_frame.headers[Headers.HEARTBEAT], '0,24000')
예제 #4
0
    def test_connect(self):
        client = AsyncClient()
        client.handle_connect()

        req_frame = client.pop_message()

        self.assertEqual(req_frame.command, Command.CONNECT)
        self.assertEqual(req_frame.headers[Headers.ACCEPT_VERSION], '1.2')
        self.assertEqual(req_frame.headers[Headers.HEARTBEAT], '0,24000')