Use HassioServiceInfo in adguard tests (#60866)
This commit is contained in:
parent
ade228ebc6
commit
272b147550
1 changed files with 21 additions and 4 deletions
|
@ -3,6 +3,7 @@ import aiohttp
|
||||||
|
|
||||||
from homeassistant import config_entries, data_entry_flow
|
from homeassistant import config_entries, data_entry_flow
|
||||||
from homeassistant.components.adguard.const import DOMAIN
|
from homeassistant.components.adguard.const import DOMAIN
|
||||||
|
from homeassistant.components.hassio.discovery import HassioServiceInfo
|
||||||
from homeassistant.config_entries import SOURCE_USER
|
from homeassistant.config_entries import SOURCE_USER
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
|
@ -121,7 +122,13 @@ async def test_hassio_already_configured(hass: HomeAssistant) -> None:
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
data={"addon": "AdGuard Home Addon", "host": "mock-adguard", "port": "3000"},
|
data=HassioServiceInfo(
|
||||||
|
config={
|
||||||
|
"addon": "AdGuard Home Addon",
|
||||||
|
"host": "mock-adguard",
|
||||||
|
"port": "3000",
|
||||||
|
}
|
||||||
|
),
|
||||||
context={"source": config_entries.SOURCE_HASSIO},
|
context={"source": config_entries.SOURCE_HASSIO},
|
||||||
)
|
)
|
||||||
assert result
|
assert result
|
||||||
|
@ -137,7 +144,13 @@ async def test_hassio_ignored(hass: HomeAssistant) -> None:
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
data={"addon": "AdGuard Home Addon", "host": "mock-adguard", "port": "3000"},
|
data=HassioServiceInfo(
|
||||||
|
config={
|
||||||
|
"addon": "AdGuard Home Addon",
|
||||||
|
"host": "mock-adguard",
|
||||||
|
"port": "3000",
|
||||||
|
}
|
||||||
|
),
|
||||||
context={"source": config_entries.SOURCE_HASSIO},
|
context={"source": config_entries.SOURCE_HASSIO},
|
||||||
)
|
)
|
||||||
assert result
|
assert result
|
||||||
|
@ -157,7 +170,9 @@ async def test_hassio_confirm(
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
data={"addon": "AdGuard Home Addon", "host": "mock-adguard", "port": 3000},
|
data=HassioServiceInfo(
|
||||||
|
config={"addon": "AdGuard Home Addon", "host": "mock-adguard", "port": 3000}
|
||||||
|
),
|
||||||
context={"source": config_entries.SOURCE_HASSIO},
|
context={"source": config_entries.SOURCE_HASSIO},
|
||||||
)
|
)
|
||||||
assert result
|
assert result
|
||||||
|
@ -191,7 +206,9 @@ async def test_hassio_connection_error(
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
data={"addon": "AdGuard Home Addon", "host": "mock-adguard", "port": 3000},
|
data=HassioServiceInfo(
|
||||||
|
config={"addon": "AdGuard Home Addon", "host": "mock-adguard", "port": 3000}
|
||||||
|
),
|
||||||
context={"source": config_entries.SOURCE_HASSIO},
|
context={"source": config_entries.SOURCE_HASSIO},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue