1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add type hints to integration tests (zha) (#88309)

This commit is contained in:
epenet
2023-02-17 18:54:26 +01:00
committed by GitHub
parent 185cd61cbd
commit 7427d4f323
28 changed files with 411 additions and 238 deletions

View File

@@ -1,11 +1,11 @@
"""Unit tests for ZHA backup platform."""
from unittest.mock import AsyncMock, patch
from homeassistant.components.zha.backup import async_post_backup, async_pre_backup
from homeassistant.core import HomeAssistant
async def test_pre_backup(hass, setup_zha):
async def test_pre_backup(hass: HomeAssistant, setup_zha) -> None:
"""Test backup creation when `async_pre_backup` is called."""
with patch("zigpy.backups.BackupManager.create_backup", AsyncMock()) as backup_mock:
await setup_zha()
@@ -14,7 +14,7 @@ async def test_pre_backup(hass, setup_zha):
backup_mock.assert_called_once_with(load_devices=True)
async def test_post_backup(hass, setup_zha):
async def test_post_backup(hass: HomeAssistant, setup_zha) -> None:
"""Test no-op `async_post_backup`."""
await setup_zha()
await async_post_backup(hass)