mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Attempt to fix CI (#34800)
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import json
|
||||
from unittest.mock import ANY, patch
|
||||
|
||||
import pytest
|
||||
|
||||
import homeassistant.components.mqtt_eventstream as eventstream
|
||||
from homeassistant.const import EVENT_STATE_CHANGED
|
||||
from homeassistant.core import State, callback
|
||||
@@ -15,24 +17,25 @@ from tests.common import (
|
||||
get_test_home_assistant,
|
||||
mock_mqtt_component,
|
||||
mock_state_change_event,
|
||||
mock_storage,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_storage(hass_storage):
|
||||
"""Autouse hass_storage for the TestCase tests."""
|
||||
|
||||
|
||||
class TestMqttEventStream:
|
||||
"""Test the MQTT eventstream module."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.mock_storage = mock_storage()
|
||||
self.mock_storage.__enter__()
|
||||
self.mock_mqtt = mock_mqtt_component(self.hass)
|
||||
|
||||
def teardown_method(self):
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
self.mock_storage.__exit__(None, None, None)
|
||||
|
||||
def add_eventstream(self, sub_topic=None, pub_topic=None, ignore_event=None):
|
||||
"""Add a mqtt_eventstream component."""
|
||||
|
||||
Reference in New Issue
Block a user