Reolink add 100% coverage of binary_sensor platfrom (#123862)

* Implement 100% coverage of binary_sensor

* fix styling

* Apply suggestions from code review

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use get().state instead of is_state

* Remove unneeded "is True"

* Remove unneeded "is True"

* reset the mock and use assert_not_called

* use freezer

* fix styling

* fix styling

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
starkillerOG
2024-08-16 12:46:51 +02:00
committed by GitHub
parent 461ef33553
commit 0093276e93
7 changed files with 170 additions and 40 deletions

View File

@@ -53,10 +53,6 @@ def mock_setup_entry() -> Generator[AsyncMock]:
def reolink_connect_class() -> Generator[MagicMock]:
"""Mock reolink connection and return both the host_mock and host_mock_class."""
with (
patch(
"homeassistant.components.reolink.host.webhook.async_register",
return_value=True,
),
patch(
"homeassistant.components.reolink.host.Host", autospec=True
) as host_mock_class,