From ec1b9c209990cb24f9e4bd6edf37fe8fdfa65a80 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 11 Nov 2020 00:03:16 +0100 Subject: [PATCH] Fix mfi test (#43067) --- tests/components/canary/conftest.py | 6 ++++++ tests/components/mfi/test_switch.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/components/canary/conftest.py b/tests/components/canary/conftest.py index 01527a193c0..ed0e7f80f8d 100644 --- a/tests/components/canary/conftest.py +++ b/tests/components/canary/conftest.py @@ -5,6 +5,12 @@ from pytest import fixture from tests.async_mock import MagicMock, patch +@fixture(autouse=True) +def mock_ffmpeg(hass): + """Mock ffmpeg is loaded.""" + hass.config.components.add("ffmpeg") + + @fixture def canary(hass): """Mock the CanaryApi for easier testing.""" diff --git a/tests/components/mfi/test_switch.py b/tests/components/mfi/test_switch.py index 77a7a72da9e..e700aad8353 100644 --- a/tests/components/mfi/test_switch.py +++ b/tests/components/mfi/test_switch.py @@ -28,7 +28,7 @@ async def test_setup_adds_proper_devices(hass): with mock.patch( "homeassistant.components.mfi.switch.MFiClient" ) as mock_client, mock.patch( - "homeassistant.components.mfi.switch.MfiSwitch" + "homeassistant.components.mfi.switch.MfiSwitch", side_effect=mfi.MfiSwitch ) as mock_switch: ports = { i: mock.MagicMock(model=model) for i, model in enumerate(mfi.SWITCH_MODELS)