Skip to content

Commit

Permalink
Slightly improve test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhowse committed Jan 4, 2021
1 parent 1ff98ad commit 4294158
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4294158

Please sign in to comment.