Set up Met during onboarding (#24622)

* Set up Met during onboarding

* Lint

* Add pyMetNo to test reqs
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2019-06-19 14:41:27 -07:00
1 parent 6ea92f86a5
commit f2962a0d16
12 files changed
+242 -54

No files matched your search

+25
View File
@@ -9,10 +9,17 @@ from homeassistant.components import onboarding
from homeassistant.components.onboarding import const, views
from tests.common import CLIENT_ID, register_auth_provider
from tests.components.met.conftest import mock_weather # noqa
from . import mock_storage
@pytest.fixture(autouse=True)
def always_mock_weather(mock_weather): # noqa
"""Mock the Met weather provider."""
pass
@pytest.fixture(autouse=True)
def auth_active(hass):
"""Ensure auth is always active."""
@@ -224,3 +231,21 @@ async def test_onboarding_integration_requires_auth(hass, hass_storage,
})
assert resp.status == 401
async def test_onboarding_core_sets_up_met(hass, hass_storage, hass_client):
"""Test finishing the core step."""
mock_storage(hass_storage, {
'done': [const.STEP_USER]
})
assert await async_setup_component(hass, 'onboarding', {})
client = await hass_client()
resp = await client.post('/api/onboarding/core_config')
assert resp.status == 200
await hass.async_block_till_done()
assert len(hass.states.async_entity_ids('weather')) == 1