Skip to content

Commit

Permalink
Add tests for diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
IceBotYT committed Apr 15, 2023
1 parent bcf2f64 commit 2436862
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/components/linear_garage_door/test_diagnostics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Test diagnostics of Linear Garage Door."""

from homeassistant.core import HomeAssistant

from .util import async_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
) -> None:
"""Test config entry diagnostics."""
entry = await async_init_integration(hass)
result = await get_diagnostics_for_config_entry(hass, hass_client, entry)

assert result["entry"]["data"] == {
"email": "**REDACTED**",
"password": "**REDACTED**",
"site_id": "test-site-id",
"device_id": "test-uuid",
}
assert result["coordinator_data"] == {
"test1": {
"name": "Test Garage 1",
"subdevices": {
"GDO": {"Open_B": "true", "Open_P": "100"},
"Light": {"On_B": "true", "On_P": "100"},
},
},
"test2": {
"name": "Test Garage 2",
"subdevices": {
"GDO": {"Open_B": "false", "Open_P": "0"},
"Light": {"On_B": "false", "On_P": "0"},
},
},
}

0 comments on commit 2436862

Please sign in to comment.