File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
"""Tests for the DeviceManager class."""
2
2
3
3
from collections .abc import Generator
4
- from unittest .mock import patch
4
+ from unittest .mock import Mock , patch
5
5
6
6
import pytest
7
7
16
16
17
17
18
18
@pytest .fixture (autouse = True )
19
- def setup_mqtt_session () -> Generator [None , None , None ]:
19
+ def setup_mqtt_session () -> Generator [Mock , None , None ]:
20
20
"""Fixture to set up the MQTT session for the tests."""
21
- with patch ("roborock.devices.device_manager.create_mqtt_session" ):
22
- yield
21
+ with patch ("roborock.devices.device_manager.create_mqtt_session" ) as mock_create_session :
22
+ mock_unsub = Mock ()
23
+ mock_create_session .return_value .subscribe .return_value = mock_unsub
24
+ yield mock_create_session
23
25
24
26
25
27
async def home_home_data_no_devices () -> HomeData :
You can’t perform that action at this time.
0 commit comments