def test_subscribe_and_publish(self):
        # Create MQTT test client.
        client = MQTTClient(self.get_test_username(), self.get_test_key())
        # Save all on_message handler responses.
        messages = []
        def on_message(mqtt_client, feed, payload):
            self.assertEqual(mqtt_client, client)
            messages.append((feed, payload))
        client.on_message = on_message
        # Connect and wait until on_connect event is fired.
        client.connect()
        self.wait_until_connected(client)
        # Subscribe to changes on a feed.
        client.subscribe('TestFeed')
        # Publish a message on the feed.
        client.publish('TestFeed', 42)
        # Wait for message to be received or timeout.
        start = time.time()
        while len(messages) == 0 and TIMEOUT_SEC < (time.time() - start):
            client.loop()
            time.sleep(0)
        # Verify one update message with payload is received.
        self.assertListEqual(messages, [('TestFeed', '42')])
dataset/ETHPy150Open adafruit/io-client-python/tests/test_mqtt_client.py/TestMQTTClient.test_subscribe_and_publish/swapped operands of `<`