mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add autospec to modbus mock, in order to use getattr (#51813)
This commit is contained in:
parent
ee6c77048c
commit
3ba90776c0
@ -97,12 +97,9 @@ async def base_test(
|
|||||||
|
|
||||||
mock_sync = mock.MagicMock()
|
mock_sync = mock.MagicMock()
|
||||||
with mock.patch(
|
with mock.patch(
|
||||||
"homeassistant.components.modbus.modbus.ModbusTcpClient", return_value=mock_sync
|
"homeassistant.components.modbus.modbus.ModbusTcpClient",
|
||||||
), mock.patch(
|
autospec=True,
|
||||||
"homeassistant.components.modbus.modbus.ModbusSerialClient",
|
|
||||||
return_value=mock_sync,
|
return_value=mock_sync,
|
||||||
), mock.patch(
|
|
||||||
"homeassistant.components.modbus.modbus.ModbusUdpClient", return_value=mock_sync
|
|
||||||
):
|
):
|
||||||
|
|
||||||
# Setup inputs for the sensor
|
# Setup inputs for the sensor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user