Prevent opening sockets in panasonic_viera tests (#56441)
This commit is contained in:
parent
a84e86ff13
commit
fc4bb40a63
1 changed files with 15 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue