Further improve MFI tests (#43167)
parent
3404e6ded1
commit
890d740093
|
@ -97,7 +97,8 @@ async def test_setup_adds_proper_devices(hass):
|
|||
"homeassistant.components.mfi.sensor.MfiSensor", side_effect=mfi.MfiSensor
|
||||
) as mock_sensor:
|
||||
ports = {
|
||||
i: mock.MagicMock(model=model) for i, model in enumerate(mfi.SENSOR_MODELS)
|
||||
i: mock.MagicMock(model=model, label=f"Port {i}", value=0)
|
||||
for i, model in enumerate(mfi.SENSOR_MODELS)
|
||||
}
|
||||
ports["bad"] = mock.MagicMock(model="notasensor")
|
||||
mock_client.return_value.get_devices.return_value = [
|
||||
|
|
|
@ -31,7 +31,10 @@ async def test_setup_adds_proper_devices(hass):
|
|||
"homeassistant.components.mfi.switch.MfiSwitch", side_effect=mfi.MfiSwitch
|
||||
) as mock_switch:
|
||||
ports = {
|
||||
i: mock.MagicMock(model=model) for i, model in enumerate(mfi.SWITCH_MODELS)
|
||||
i: mock.MagicMock(
|
||||
model=model, label=f"Port {i}", output=False, data={}, ident=f"abcd-{i}"
|
||||
)
|
||||
for i, model in enumerate(mfi.SWITCH_MODELS)
|
||||
}
|
||||
ports["bad"] = mock.MagicMock(model="notaswitch")
|
||||
print(ports["bad"].model)
|
||||
|
|
Loading…
Reference in New Issue