Use HassioServiceInfo in adguard tests (#60866)

pull/60867/head
epenet 2021-12-02 21:10:15 +01:00 committed by GitHub
parent ade228ebc6
commit 272b147550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import aiohttp
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.adguard.const import DOMAIN
from homeassistant.components.hassio.discovery import HassioServiceInfo
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import (
CONF_HOST,
@ -121,7 +122,13 @@ async def test_hassio_already_configured(hass: HomeAssistant) -> None:
result = await hass.config_entries.flow.async_init(
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},
)
assert result
@ -137,7 +144,13 @@ async def test_hassio_ignored(hass: HomeAssistant) -> None:
result = await hass.config_entries.flow.async_init(
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},
)
assert result
@ -157,7 +170,9 @@ async def test_hassio_confirm(
result = await hass.config_entries.flow.async_init(
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},
)
assert result
@ -191,7 +206,9 @@ async def test_hassio_connection_error(
result = await hass.config_entries.flow.async_init(
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},
)