1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-27 05:14:39 +00:00
Files
core/tests/components/wmspro/test_diagnostics.py
Marc Hörsken c3abf5a190 Add support for WMS roller shutters and blinds (#132645)
* Add support for WMS roller shutters and blinds

* Add test variants for WMS device types and their diagnostics

* Add test variants for cover movement of WMS device types

* Move device entry tests to test_init and avoid snapshot list

Suggested-by: joostlek
2025-04-30 20:51:10 +02:00

46 lines
1.3 KiB
Python

"""Test the wmspro diagnostics."""
from unittest.mock import AsyncMock
import pytest
from syrupy import SnapshotAssertion
from homeassistant.core import HomeAssistant
from . import setup_config_entry
from tests.common import MockConfigEntry
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
@pytest.mark.parametrize(
("mock_hub_configuration"),
[
("mock_hub_configuration_prod_awning_dimmer"),
("mock_hub_configuration_prod_roller_shutter"),
],
)
async def test_diagnostics(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
mock_config_entry: MockConfigEntry,
mock_hub_ping: AsyncMock,
mock_hub_configuration: AsyncMock,
mock_dest_refresh: AsyncMock,
snapshot: SnapshotAssertion,
request: pytest.FixtureRequest,
) -> None:
"""Test that a config entry can be loaded with DeviceConfig."""
mock_hub_configuration = request.getfixturevalue(mock_hub_configuration)
assert await setup_config_entry(hass, mock_config_entry)
assert len(mock_hub_ping.mock_calls) == 1
assert len(mock_hub_configuration.mock_calls) == 1
assert len(mock_dest_refresh.mock_calls) > 0
result = await get_diagnostics_for_config_entry(
hass, hass_client, mock_config_entry
)
assert result == snapshot