mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Fix incorrect mock in whirlpool (#86331)
* Added async according to error logs * changed Asyncmock to magicmock get_aircon_mock * changed attr_callback to MagicMock for sensor_mock
This commit is contained in:
parent
91c502ae55
commit
f608e150fd
@ -1,6 +1,6 @@
|
||||
"""Fixtures for the Whirlpool Sixth Sense integration tests."""
|
||||
from unittest import mock
|
||||
from unittest.mock import AsyncMock
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
import whirlpool
|
||||
@ -63,7 +63,7 @@ def get_aircon_mock(said):
|
||||
mock_aircon = mock.Mock(said=said)
|
||||
mock_aircon.connect = AsyncMock()
|
||||
mock_aircon.disconnect = AsyncMock()
|
||||
mock_aircon.register_attr_callback = AsyncMock()
|
||||
mock_aircon.register_attr_callback = MagicMock()
|
||||
mock_aircon.get_online.return_value = True
|
||||
mock_aircon.get_power_on.return_value = True
|
||||
mock_aircon.get_mode.return_value = whirlpool.aircon.Mode.Cool
|
||||
@ -124,7 +124,7 @@ def get_sensor_mock(said):
|
||||
mock_sensor = mock.Mock(said=said)
|
||||
mock_sensor.connect = AsyncMock()
|
||||
mock_sensor.disconnect = AsyncMock()
|
||||
mock_sensor.register_attr_callback = AsyncMock()
|
||||
mock_sensor.register_attr_callback = MagicMock()
|
||||
mock_sensor.get_online.return_value = True
|
||||
mock_sensor.get_machine_state.return_value = (
|
||||
whirlpool.washerdryer.MachineState.Standby
|
||||
|
Loading…
x
Reference in New Issue
Block a user