Add type hints to integration tests (d-e) (#87699)

This commit is contained in:
epenet 2023-02-08 13:01:44 +01:00 committed by GitHub
parent 5e214f2e43
commit 3052de3e8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 765 additions and 450 deletions

View file

@ -6,11 +6,13 @@ import pytest
from homeassistant.components import duckdns
from homeassistant.components.duckdns import async_track_time_interval_backoff
from homeassistant.core import HomeAssistant
from homeassistant.loader import bind_hass
from homeassistant.setup import async_setup_component
from homeassistant.util.dt import utcnow
from tests.common import async_fire_time_changed
from tests.test_util.aiohttp import AiohttpClientMocker
DOMAIN = "bla"
TOKEN = "abcdefgh"
@ -43,7 +45,7 @@ def setup_duckdns(hass, aioclient_mock):
)
async def test_setup(hass, aioclient_mock):
async def test_setup(hass: HomeAssistant, aioclient_mock: AiohttpClientMocker) -> None:
"""Test setup works if update passes."""
aioclient_mock.get(
duckdns.UPDATE_URL, params={"domains": DOMAIN, "token": TOKEN}, text="OK"
@ -63,7 +65,9 @@ async def test_setup(hass, aioclient_mock):
assert aioclient_mock.call_count == 2
async def test_setup_backoff(hass, aioclient_mock):
async def test_setup_backoff(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test setup fails if first update fails."""
aioclient_mock.get(
duckdns.UPDATE_URL, params={"domains": DOMAIN, "token": TOKEN}, text="KO"
@ -128,7 +132,7 @@ async def test_service_clear_txt(hass, aioclient_mock, setup_duckdns):
assert aioclient_mock.call_count == 1
async def test_async_track_time_interval_backoff(hass):
async def test_async_track_time_interval_backoff(hass: HomeAssistant) -> None:
"""Test setup fails if first update fails."""
ret_val = False
call_count = 0