init home-assistant

This commit is contained in:
2026-11-19 15:15:32 -05:00
parent 2e81d9d300
commit feec6ef9fb
19230 changed files with 3335526 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
"""Define tests for the The Things Network init."""
import pytest
from ttn_client import TTNAuthError
from homeassistant.core import HomeAssistant
@pytest.mark.parametrize(("exception_class"), [TTNAuthError, Exception])
async def test_init_exceptions(
hass: HomeAssistant, mock_ttnclient, exception_class, mock_config_entry
) -> None:
"""Test TTN Exceptions."""
mock_ttnclient.return_value.fetch_data.side_effect = exception_class
mock_config_entry.add_to_hass(hass)
assert not await hass.config_entries.async_setup(mock_config_entry.entry_id)