1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Attempt to fix CI (#34800)

This commit is contained in:
Paulus Schoutsen
2020-04-28 10:31:22 -07:00
committed by GitHub
parent c29c0e7e13
commit 454c5d824a
10 changed files with 224 additions and 244 deletions

View File

@@ -1,6 +1,8 @@
"""The tests for the MQTT statestream component."""
from unittest.mock import ANY, call, patch
import pytest
import homeassistant.components.mqtt_statestream as statestream
from homeassistant.core import State
from homeassistant.setup import setup_component
@@ -9,24 +11,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 TestMqttStateStream:
"""Test the MQTT statestream 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_statestream(
self,