Pass hass_config to load_platform (#17952)
* Pass hass_config to load_platform * Fix tests * Lint
This commit is contained in:
1 parent
b03e6050c5
commit
6ae345b01c
21 files changed
+70
-56
No files matched your search
@@ -181,7 +181,7 @@ class TestComponentsDeviceTracker(unittest.TestCase):
|
||||
assert device_tracker.DOMAIN not in self.hass.config.components
|
||||
discovery.load_platform(
|
||||
self.hass, device_tracker.DOMAIN, 'demo', {'test_key': 'test_val'},
|
||||
{})
|
||||
{'demo': {}})
|
||||
self.hass.block_till_done()
|
||||
assert device_tracker.DOMAIN in self.hass.config.components
|
||||
assert mock_demo_setup_scanner.called
|
||||
|
||||
@@ -524,7 +524,7 @@ async def test_custom_availability_payload(hass, mqtt_mock):
|
||||
|
||||
async def test_discovery_removal(hass, mqtt_mock, caplog):
|
||||
"""Test removal of discovered mqtt_json lights."""
|
||||
await async_start(hass, 'homeassistant', {})
|
||||
await async_start(hass, 'homeassistant', {'mqtt': {}})
|
||||
data = (
|
||||
'{ "name": "Beer",'
|
||||
' "platform": "mqtt_json",'
|
||||
|
||||
@@ -136,7 +136,7 @@ async def test_custom_availability_payload(hass, mqtt_mock):
|
||||
|
||||
async def test_discovery_removal_lock(hass, mqtt_mock, caplog):
|
||||
"""Test removal of discovered lock."""
|
||||
await async_start(hass, 'homeassistant', {})
|
||||
await async_start(hass, 'homeassistant', {'mqtt': {}})
|
||||
data = (
|
||||
'{ "name": "Beer",'
|
||||
' "command_topic": "test_topic" }'
|
||||
|
||||
@@ -65,7 +65,8 @@ class TestNotifyDemo(unittest.TestCase):
|
||||
"""Test discovery of notify demo platform."""
|
||||
assert notify.DOMAIN not in self.hass.config.components
|
||||
discovery.load_platform(
|
||||
self.hass, 'notify', 'demo', {'test_key': 'test_val'}, {})
|
||||
self.hass, 'notify', 'demo', {'test_key': 'test_val'},
|
||||
{'notify': {}})
|
||||
self.hass.block_till_done()
|
||||
assert notify.DOMAIN in self.hass.config.components
|
||||
assert mock_demo_get_service.called
|
||||
|
||||
@@ -85,7 +85,8 @@ class TestGoogle(unittest.TestCase):
|
||||
|
||||
calendar_service = google.GoogleCalendarService(
|
||||
self.hass.config.path(google.TOKEN_FILE))
|
||||
assert google.setup_services(self.hass, True, calendar_service)
|
||||
assert google.setup_services(
|
||||
self.hass, {'google': {}}, True, calendar_service)
|
||||
# self.hass.services.call('google', 'found_calendar', calendar,
|
||||
# blocking=True)
|
||||
|
||||
|
||||
Reference in new issue
Block a user