mirror of
https://github.com/home-assistant/core.git
synced 2026-02-23 03:17:06 +00:00
* Migrate to config flow * Fixes & add code owner * Add codeowners * Import within notify module * Fixes from review * Fixes * Remove config schema
26 lines
680 B
Python
26 lines
680 B
Python
"""Tests for the Mastodon integration."""
|
|
|
|
from unittest.mock import AsyncMock
|
|
|
|
from mastodon.Mastodon import MastodonError
|
|
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from . import setup_integration
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def test_initialization_failure(
|
|
hass: HomeAssistant,
|
|
mock_mastodon_client: AsyncMock,
|
|
mock_config_entry: MockConfigEntry,
|
|
) -> None:
|
|
"""Test initialization failure."""
|
|
mock_mastodon_client.instance.side_effect = MastodonError
|
|
|
|
await setup_integration(hass, mock_config_entry)
|
|
|
|
assert mock_config_entry.state is ConfigEntryState.SETUP_RETRY
|