Delegate mqtt topic match validation to the paho mqtt client (#16403)

* Delegate mqtt match topics to the paho mqtt client

* Fixing linting error with importing MQTTMatcher
This commit is contained in:
Rohan Kapoor authored and Paulus Schoutsen committed 2018-09-04 10:31:45 +02:00
1 parent 8fa9992589
commit e61ac1a4a1
2 files changed
+17 -18

No files matched your search

+9
View File
@@ -277,6 +277,15 @@ class TestMQTTCallbacks(unittest.TestCase):
self.hass.block_till_done()
self.assertEqual(0, len(self.calls))
def test_subscribe_topic_level_wildcard_root_topic_no_subtree_match(self):
"""Test the subscription of wildcard topics."""
mqtt.subscribe(self.hass, 'test-topic/#', self.record_calls)
fire_mqtt_message(self.hass, 'test-topic-123', 'test-payload')
self.hass.block_till_done()
self.assertEqual(0, len(self.calls))
def test_subscribe_topic_subtree_wildcard_subtree_topic(self):
"""Test the subscription of wildcard topics."""
mqtt.subscribe(self.hass, 'test-topic/#', self.record_calls)