Use mock storage for MQTT tests (#33553)
* mock storage for MQTT * more mqtt storage mocks
This commit is contained in:
1 parent
36a606f81d
commit
201e958854
4 files changed
+19
-1
No files matched your search
@@ -15,6 +15,7 @@ from tests.common import (
|
||||
get_test_home_assistant,
|
||||
mock_mqtt_component,
|
||||
mock_state_change_event,
|
||||
mock_storage,
|
||||
)
|
||||
|
||||
|
||||
@@ -24,11 +25,14 @@ class TestMqttEventStream:
|
||||
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