hass-core/tests/components/accuweather/test_diagnostics.py
Maciej Bieniek 09be56964d
AccuWeather tests refactoring (#116923)
* Add mock_accuweather_client

* Improve tests

* Fix exceptions

* Remove unneeded update_listener()

* Fix arguments for fixtures

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-06 19:41:48 +02:00

26 lines
690 B
Python

"""Test AccuWeather diagnostics."""
from unittest.mock import AsyncMock
from syrupy import SnapshotAssertion
from homeassistant.core import HomeAssistant
from . import init_integration
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
async def test_entry_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
mock_accuweather_client: AsyncMock,
snapshot: SnapshotAssertion,
) -> None:
"""Test config entry diagnostics."""
entry = await init_integration(hass)
result = await get_diagnostics_for_config_entry(hass, hass_client, entry)
assert result == snapshot