def test_coro(): try: client = MQTTClient() ret = yield from client.connect('mqtt://test.mosquitto.org/') self.assertIsNotNone(client.session) yield from client.ping() yield from client.disconnect() future.set_result(True) except Exception as ae: future.set_exception(ae)
def test_coro(): try: broker = Broker(broker_config, plugin_namespace="hbmqtt.test.plugins") yield from broker.start() client = MQTTClient() yield from client.connect('mqtt://127.0.0.1/') self.assertIsNotNone(client.session) yield from client.ping() yield from client.disconnect() yield from broker.shutdown() future.set_result(True) except Exception as ae: future.set_exception(ae)