diff --git a/tests/test_mqtt.py b/tests/test_mqtt.py index 2e65104..d756e9c 100644 --- a/tests/test_mqtt.py +++ b/tests/test_mqtt.py @@ -416,6 +416,11 @@ def test_type(self): m._on_message(None, None, msg) self.assertEqual(self.modbus_tables['holding'][0], 65534) + msg = MQTTMessage(topic=bytes(MQTT_TOPIC_PREFIX+'/publish_int16_1_set', 'utf-8')) + msg.payload = b'2' + m._on_message(None, None, msg) + self.assertEqual(self.modbus_tables['holding'][0], 2) + msg = MQTTMessage(topic=bytes(MQTT_TOPIC_PREFIX+'/publish_uint16_1_set', 'utf-8')) msg.payload = b'65533' m._on_message(None, None, msg)