hass-core/tests/components/guardian/conftest.py
Aaron Bach 369745c4cf
Add support for Elexa Guardian water valve controllers (#34627)
* Add support for Elexa Guardian water valve controllers

* Zeroconf + cleanup

* Sensors and services

* API registration

* Service bug fixes

* Fix bug in cleanup

* Tests and coverage

* Fix incorrect service description

* Bump aioguardian

* Bump aioguardian to 0.2.2

* Bump aioguardian to 0.2.3

* Proper entity inheritance

* Give device a proper name

* Code review
2020-05-26 08:47:25 -05:00

17 lines
578 B
Python

"""Define fixtures for Elexa Guardian tests."""
from asynctest import patch
import pytest
@pytest.fixture()
def ping_client():
"""Define a patched client that returns a successful ping response."""
with patch(
"homeassistant.components.guardian.async_setup_entry", return_value=True
), patch("aioguardian.client.Client.connect"), patch(
"aioguardian.commands.device.Device.ping",
return_value={"command": 0, "status": "ok", "data": {"uid": "ABCDEF123456"}},
), patch(
"aioguardian.client.Client.disconnect"
):
yield