mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add missing mock in brother config flow tests (#89354)
This commit is contained in:
parent
58280dc2ec
commit
adb4414440
14
tests/components/brother/conftest.py
Normal file
14
tests/components/brother/conftest.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
"""Test fixtures for brother."""
|
||||||
|
from collections.abc import Generator
|
||||||
|
from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||||||
|
"""Override async_setup_entry."""
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.brother.async_setup_entry", return_value=True
|
||||||
|
) as mock_setup_entry:
|
||||||
|
yield mock_setup_entry
|
@ -3,6 +3,7 @@ import json
|
|||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from brother import SnmpError, UnsupportedModelError
|
from brother import SnmpError, UnsupportedModelError
|
||||||
|
import pytest
|
||||||
|
|
||||||
from homeassistant import data_entry_flow
|
from homeassistant import data_entry_flow
|
||||||
from homeassistant.components import zeroconf
|
from homeassistant.components import zeroconf
|
||||||
@ -15,6 +16,8 @@ from tests.common import MockConfigEntry, load_fixture
|
|||||||
|
|
||||||
CONFIG = {CONF_HOST: "127.0.0.1", CONF_TYPE: "laser"}
|
CONFIG = {CONF_HOST: "127.0.0.1", CONF_TYPE: "laser"}
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||||
|
|
||||||
|
|
||||||
async def test_show_form(hass: HomeAssistant) -> None:
|
async def test_show_form(hass: HomeAssistant) -> None:
|
||||||
"""Test that the form is served with no input."""
|
"""Test that the form is served with no input."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user