mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +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 pywilight
|
||||
from pywilight.const import DOMAIN
|
||||
import requests
|
||||
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -41,6 +42,10 @@ def mock_dummy_device_from_host():
|
||||
|
||||
async def test_config_entry_not_ready(hass: HomeAssistant) -> None:
|
||||
"""Test the WiLight configuration entry not ready."""
|
||||
with patch(
|
||||
"pywilight.device_from_host",
|
||||
side_effect=requests.exceptions.Timeout,
|
||||
):
|
||||
entry = await setup_integration(hass)
|
||||
|
||||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
Loading…
x
Reference in New Issue
Block a user