Mock Radio Browser entry setup in onboarding tests (#67905)

This commit is contained in:
Franck Nijhof 2022-03-09 15:41:14 +01:00 committed by GitHub
parent 3dc100e816
commit a8ad9fc5f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -390,12 +390,16 @@ async def test_onboarding_core_sets_up_radio_browser(hass, hass_storage, hass_cl
client = await hass_client()
resp = await client.post("/api/onboarding/core_config")
with patch(
"homeassistant.components.radio_browser.async_setup_entry", return_value=True
) as mock_setup:
resp = await client.post("/api/onboarding/core_config")
assert resp.status == 200
await hass.async_block_till_done()
assert len(hass.config_entries.async_entries("radio_browser")) == 1
assert len(mock_setup.mock_calls) == 1
async def test_onboarding_core_sets_up_rpi_power(