Fix mfi test (#43067)
This commit is contained in:
parent
7745408440
commit
ec1b9c2099
2 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,12 @@ from pytest import fixture
|
||||||
from tests.async_mock import MagicMock, patch
|
from tests.async_mock import MagicMock, patch
|
||||||
|
|
||||||
|
|
||||||
|
@fixture(autouse=True)
|
||||||
|
def mock_ffmpeg(hass):
|
||||||
|
"""Mock ffmpeg is loaded."""
|
||||||
|
hass.config.components.add("ffmpeg")
|
||||||
|
|
||||||
|
|
||||||
@fixture
|
@fixture
|
||||||
def canary(hass):
|
def canary(hass):
|
||||||
"""Mock the CanaryApi for easier testing."""
|
"""Mock the CanaryApi for easier testing."""
|
||||||
|
|
|
@ -28,7 +28,7 @@ async def test_setup_adds_proper_devices(hass):
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
"homeassistant.components.mfi.switch.MFiClient"
|
"homeassistant.components.mfi.switch.MFiClient"
|
||||||
) as mock_client, mock.patch(
|
) as mock_client, mock.patch(
|
||||||
"homeassistant.components.mfi.switch.MfiSwitch"
|
"homeassistant.components.mfi.switch.MfiSwitch", side_effect=mfi.MfiSwitch
|
||||||
) as mock_switch:
|
) as mock_switch:
|
||||||
ports = {
|
ports = {
|
||||||
i: mock.MagicMock(model=model) for i, model in enumerate(mfi.SWITCH_MODELS)
|
i: mock.MagicMock(model=model) for i, model in enumerate(mfi.SWITCH_MODELS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue