mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Use pytest for more MQTT tests (#36859)
* Use pytest for more MQTT tests * Address review comments * Break out PAHO client mock in separate fixture. * tweak.
This commit is contained in:
@@ -344,10 +344,13 @@ async def async_mock_mqtt_component(hass, config=None):
|
||||
assert result
|
||||
await hass.async_block_till_done()
|
||||
|
||||
hass.data["mqtt"] = MagicMock(
|
||||
mqtt_component_mock = MagicMock(
|
||||
spec_set=hass.data["mqtt"], wraps=hass.data["mqtt"]
|
||||
)
|
||||
hass.data["mqtt"].connected = mqtt_component_mock.connected
|
||||
mqtt_component_mock._mqttc = mock_client
|
||||
|
||||
hass.data["mqtt"] = mqtt_component_mock
|
||||
return hass.data["mqtt"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user