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:
1 parent
3a83f4bdbe
commit
a2e2c35011
4 files changed
+570
-509
No files matched your search
+4
-1
@@ -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