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:
1 parent
1a05f7b04d
commit
590eead128
20 files changed
+68
-48
No files matched your search
@@ -113,34 +113,34 @@ def mock_dev_track(mock_device_tracker_conf):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def geofency_client(loop, hass, aiohttp_client):
|
||||
async def geofency_client(loop, hass, aiohttp_client):
|
||||
"""Geofency mock client (unauthenticated)."""
|
||||
assert loop.run_until_complete(async_setup_component(
|
||||
hass, 'persistent_notification', {}))
|
||||
assert await async_setup_component(
|
||||
hass, 'persistent_notification', {})
|
||||
|
||||
assert loop.run_until_complete(async_setup_component(
|
||||
assert await async_setup_component(
|
||||
hass, DOMAIN, {
|
||||
DOMAIN: {
|
||||
CONF_MOBILE_BEACONS: ['Car 1']
|
||||
}}))
|
||||
|
||||
loop.run_until_complete(hass.async_block_till_done())
|
||||
}})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
with patch('homeassistant.components.device_tracker.update_config'):
|
||||
yield loop.run_until_complete(aiohttp_client(hass.http.app))
|
||||
return await aiohttp_client(hass.http.app)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_zones(loop, hass):
|
||||
async def setup_zones(loop, hass):
|
||||
"""Set up Zone config in HA."""
|
||||
assert loop.run_until_complete(async_setup_component(
|
||||
assert await async_setup_component(
|
||||
hass, zone.DOMAIN, {
|
||||
'zone': {
|
||||
'name': 'Home',
|
||||
'latitude': HOME_LATITUDE,
|
||||
'longitude': HOME_LONGITUDE,
|
||||
'radius': 100,
|
||||
}}))
|
||||
}})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -156,6 +156,7 @@ async def webhook_id(hass, geofency_client):
|
||||
result['flow_id'], {})
|
||||
assert result['type'] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
|
||||
await hass.async_block_till_done()
|
||||
return result['result'].data['webhook_id']
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user