1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Fix iskra tests opening sockets (#156374)

This commit is contained in:
Erik Montnemery
2025-11-11 21:18:14 +01:00
committed by GitHub
parent 936151fae5
commit 2dadc1f2b3

View File

@@ -1,5 +1,8 @@
"""Tests for the Iskra config flow."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
from pyiskra.exceptions import (
DeviceConnectionError,
DeviceTimeoutError,
@@ -35,6 +38,15 @@ from .const import (
from tests.common import MockConfigEntry
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.iskra.async_setup_entry", return_value=True
) as mock_setup_entry:
yield mock_setup_entry
# Test step_user with Rest API protocol
async def test_user_rest_no_auth(hass: HomeAssistant, mock_pyiskra_rest) -> None:
"""Test the user flow with Rest API protocol."""