mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +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()
|
||||
with mock.patch(
|
||||
"homeassistant.components.modbus.modbus.ModbusTcpClient", return_value=mock_sync
|
||||
), mock.patch(
|
||||
"homeassistant.components.modbus.modbus.ModbusSerialClient",
|
||||
"homeassistant.components.modbus.modbus.ModbusTcpClient",
|
||||
autospec=True,
|
||||
return_value=mock_sync,
|
||||
), mock.patch(
|
||||
"homeassistant.components.modbus.modbus.ModbusUdpClient", return_value=mock_sync
|
||||
):
|
||||
|
||||
# Setup inputs for the sensor
|
||||
|
Loading…
x
Reference in New Issue
Block a user