1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Test fixes (#22911)

* Fix light tests [skip ci]

* Fix tests/common

* Fix some mqtt tests [skip ci]

* Fix tests and component manifests which have only one platform

* Fix more tests and manifests

* Fix demo/notify tests

* Rollback test for demo.geo_location
This commit is contained in:
Paulus Schoutsen
2019-04-08 23:16:55 -07:00
committed by GitHub
parent 1a05f7b04d
commit 590eead128
20 changed files with 68 additions and 48 deletions

View File

@@ -28,8 +28,7 @@ def mock_MQTT():
yield mock_MQTT
@asyncio.coroutine
def async_mock_mqtt_client(hass, config=None):
async def async_mock_mqtt_client(hass, config=None):
"""Mock the MQTT paho client."""
if config is None:
config = {mqtt.CONF_BROKER: 'mock-broker'}
@@ -39,10 +38,11 @@ def async_mock_mqtt_client(hass, config=None):
mock_client().subscribe.return_value = (0, 0)
mock_client().unsubscribe.return_value = (0, 0)
mock_client().publish.return_value = (0, 0)
result = yield from async_setup_component(hass, mqtt.DOMAIN, {
result = await async_setup_component(hass, mqtt.DOMAIN, {
mqtt.DOMAIN: config
})
assert result
await hass.async_block_till_done()
return mock_client()