From c425056368c18e3c3a4fb4044fef93bdae7f1f9d Mon Sep 17 00:00:00 2001 From: Andrew Mirsky Date: Mon, 4 Aug 2025 11:24:05 -0400 Subject: [PATCH] Yakifo/amqtt#120 confirms : validate example is functioning --- tests/test_broker.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/test_broker.py b/tests/test_broker.py index b7f563c..ea68097 100644 --- a/tests/test_broker.py +++ b/tests/test_broker.py @@ -934,6 +934,35 @@ async def test_broker_socket_open_close(broker): await asyncio.sleep(0.1) s.close() +std_legacy_config = { + "listeners": { + "default": { + "type": "tcp", + "bind": f"127.0.0.1:1883", + } + }, + "sys_interval": 10, + "auth": { + "allow-anonymous": True, + "plugins": ["auth_anonymous"], + }, + "topic-check": {"enabled": False}, + } + + +@pytest.mark.asyncio +async def test_broker_with_legacy_config(): + + broker = Broker(config=std_legacy_config) + + await broker.start() + await asyncio.sleep(2) + + mqtt_client = MQTTClient(config={'auto_reconnect': False}) + await mqtt_client.connect() + + await broker.shutdown() + legacy_config_empty_auth_plugin_list = { "listeners": {