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:
Luke 2023-01-21 14:18:43 -05:00 committed by GitHub
parent 91c502ae55
commit f608e150fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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