1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-17 15:44:52 +01:00

Mock async_setup_entry in jvc_projector config flow tests (#164401)

This commit is contained in:
Franck Nijhof
2026-02-27 20:53:38 +01:00
committed by GitHub
parent 74240ecd26
commit 667e8c4d38

View File

@@ -1,6 +1,7 @@
"""Tests for JVC Projector config flow."""
from unittest.mock import AsyncMock
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
from jvcprojector import JvcProjectorAuthError, JvcProjectorTimeoutError
import pytest
@@ -18,6 +19,16 @@ from tests.common import MockConfigEntry
TARGET = "homeassistant.components.jvc_projector.config_flow.JvcProjector"
@pytest.fixture(autouse=True)
def mock_setup_entry() -> Generator[AsyncMock]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.jvc_projector.async_setup_entry",
return_value=True,
) as mock_setup_entry:
yield mock_setup_entry
@pytest.mark.parametrize("mock_device", [{"target": TARGET}], indirect=True)
async def test_user_config_flow_success(
hass: HomeAssistant, mock_device: AsyncMock