Add 100% coverage of Reolink button platform (#124380)

* Add 100% button coverage

* review comments

* fix

* Use SERVICE_PRESS constant

* Use DOMAIN instead of const.DOMAIN

* styling

* User entity_registry_enabled_by_default fixture

* fixes

* Split out ptz_move test

* use SERVICE_PTZ_MOVE constant
This commit is contained in:
starkillerOG
2024-09-04 12:16:57 +02:00
committed by GitHub
parent fb5afff9d5
commit 4b111008df
7 changed files with 164 additions and 57 deletions

View File

@@ -14,9 +14,8 @@ from homeassistant.components.media_source import (
async_resolve_media,
)
from homeassistant.components.media_source.error import Unresolvable
from homeassistant.components.reolink import const
from homeassistant.components.reolink.config_flow import DEFAULT_PROTOCOL
from homeassistant.components.reolink.const import DOMAIN
from homeassistant.components.reolink.const import CONF_USE_HTTPS, DOMAIN
from homeassistant.components.stream import DOMAIN as MEDIA_STREAM_DOMAIN
from homeassistant.const import (
CONF_HOST,
@@ -321,14 +320,14 @@ async def test_browsing_not_loaded(
reolink_connect.get_host_data.side_effect = ReolinkError("Test error")
config_entry2 = MockConfigEntry(
domain=const.DOMAIN,
domain=DOMAIN,
unique_id=format_mac(TEST_MAC2),
data={
CONF_HOST: TEST_HOST2,
CONF_USERNAME: TEST_USERNAME2,
CONF_PASSWORD: TEST_PASSWORD2,
CONF_PORT: TEST_PORT,
const.CONF_USE_HTTPS: TEST_USE_HTTPS,
CONF_USE_HTTPS: TEST_USE_HTTPS,
},
options={
CONF_PROTOCOL: DEFAULT_PROTOCOL,