Fix uncaught error in OpenUV diagnostics test (#80116)

This commit is contained in:
Aaron Bach 2022-10-11 10:19:13 -06:00 committed by GitHub
parent 4ea46bf841
commit 2f6e55b3bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,14 +1,19 @@
"""Test OpenUV diagnostics.""" """Test OpenUV diagnostics."""
from homeassistant.components.diagnostics import REDACTED from homeassistant.components.diagnostics import REDACTED
from homeassistant.components.openuv import CONF_ENTRY_ID from homeassistant.const import CONF_ENTITY_ID
from homeassistant.setup import async_setup_component
from tests.components.diagnostics import get_diagnostics_for_config_entry from tests.components.diagnostics import get_diagnostics_for_config_entry
async def test_entry_diagnostics(hass, config_entry, hass_client, setup_openuv): async def test_entry_diagnostics(hass, config_entry, hass_client, setup_openuv):
"""Test config entry diagnostics.""" """Test config entry diagnostics."""
await async_setup_component(hass, "homeassistant", {})
await hass.services.async_call( await hass.services.async_call(
"openuv", "update_data", service_data={CONF_ENTRY_ID: "test_entry_id"} "homeassistant",
"update_entity",
{CONF_ENTITY_ID: ["sensor.current_uv_index"]},
blocking=True,
) )
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == { assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
"entry": { "entry": {