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')
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')