mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Prevent 3rd party lib from opening sockets in wilight tests (#56310)
This commit is contained in:
parent
797b68b42d
commit
ecf4a7813a
@ -4,6 +4,7 @@ from unittest.mock import patch
|
|||||||
import pytest
|
import pytest
|
||||||
import pywilight
|
import pywilight
|
||||||
from pywilight.const import DOMAIN
|
from pywilight.const import DOMAIN
|
||||||
|
import requests
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -41,7 +42,11 @@ def mock_dummy_device_from_host():
|
|||||||
|
|
||||||
async def test_config_entry_not_ready(hass: HomeAssistant) -> None:
|
async def test_config_entry_not_ready(hass: HomeAssistant) -> None:
|
||||||
"""Test the WiLight configuration entry not ready."""
|
"""Test the WiLight configuration entry not ready."""
|
||||||
entry = await setup_integration(hass)
|
with patch(
|
||||||
|
"pywilight.device_from_host",
|
||||||
|
side_effect=requests.exceptions.Timeout,
|
||||||
|
):
|
||||||
|
entry = await setup_integration(hass)
|
||||||
|
|
||||||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user