diff --git a/tests/components/panasonic_viera/test_init.py b/tests/components/panasonic_viera/test_init.py index 0f30e315683..e3fc74133d3 100644 --- a/tests/components/panasonic_viera/test_init.py +++ b/tests/components/panasonic_viera/test_init.py @@ -1,5 +1,5 @@ """Test the Panasonic Viera setup process.""" -from unittest.mock import patch +from unittest.mock import Mock, patch from homeassistant.components.panasonic_viera.const import ( ATTR_DEVICE_INFO, @@ -185,14 +185,21 @@ async def test_setup_entry_unencrypted_missing_device_info_none(hass): async def test_setup_config_flow_initiated(hass): """Test if config flow is initiated in setup.""" - assert ( - await async_setup_component( - hass, - DOMAIN, - {DOMAIN: {CONF_HOST: "0.0.0.0"}}, + mock_remote = get_mock_remote() + mock_remote.get_device_info = Mock(side_effect=OSError) + + with patch( + "homeassistant.components.panasonic_viera.config_flow.RemoteControl", + return_value=mock_remote, + ): + assert ( + await async_setup_component( + hass, + DOMAIN, + {DOMAIN: {CONF_HOST: "0.0.0.0"}}, + ) + is True ) - is True - ) assert len(hass.config_entries.flow.async_progress()) == 1