Migrate mqtt tracker and arwn sensor to async / cleanup owntrack (#6373)
* Migrate mqtt tracker and arwn sensor to async / cleanup owntrack * Fix tests / lint
This commit is contained in:
1 parent
55f8ec8866
commit
ed9e93c29f
4 files changed
+35
-25
No files matched your search
@@ -1,4 +1,5 @@
|
||||
"""The tests for the MQTT device tracker platform."""
|
||||
import asyncio
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
import logging
|
||||
@@ -33,12 +34,13 @@ class TestComponentsDeviceTrackerMQTT(unittest.TestCase):
|
||||
def test_ensure_device_tracker_platform_validation(self): \
|
||||
# pylint: disable=invalid-name
|
||||
"""Test if platform validation was done."""
|
||||
@asyncio.coroutine
|
||||
def mock_setup_scanner(hass, config, see, discovery_info=None):
|
||||
"""Check that Qos was added by validation."""
|
||||
self.assertTrue('qos' in config)
|
||||
|
||||
with patch('homeassistant.components.device_tracker.mqtt.'
|
||||
'setup_scanner', autospec=True,
|
||||
'async_setup_scanner', autospec=True,
|
||||
side_effect=mock_setup_scanner) as mock_sp:
|
||||
|
||||
dev_id = 'paulus'
|
||||
|
||||
Reference in new issue
Block a user