Fix mqtt check in ozw (#45709)

This commit is contained in:
Martin Hjelmare 2021-01-29 17:57:39 +01:00 committed by GitHub
parent b2789621bd
commit bcc9add0b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 9 deletions

View file

@ -4,9 +4,11 @@ from unittest.mock import patch
import pytest
from homeassistant.config_entries import ENTRY_STATE_LOADED
from .common import MQTTMessage
from tests.common import load_fixture
from tests.common import MockConfigEntry, load_fixture
from tests.components.light.conftest import mock_light_profiles # noqa
@ -268,3 +270,11 @@ def mock_get_addon_discovery_info():
"homeassistant.components.hassio.async_get_addon_discovery_info"
) as get_addon_discovery_info:
yield get_addon_discovery_info
@pytest.fixture(name="mqtt")
async def mock_mqtt_fixture(hass):
"""Mock the MQTT integration."""
mqtt_entry = MockConfigEntry(domain="mqtt", state=ENTRY_STATE_LOADED)
mqtt_entry.add_to_hass(hass)
return mqtt_entry