35 lines
891 B
Python
35 lines
891 B
Python
|
"""Fixtures for Whois integration tests."""
|
||
|
from __future__ import annotations
|
||
|
|
||
|
from collections.abc import Generator
|
||
|
from unittest.mock import AsyncMock, patch
|
||
|
|
||
|
import pytest
|
||
|
|
||
|
from homeassistant.components.whois.const import DOMAIN
|
||
|
from homeassistant.const import CONF_DOMAIN
|
||
|
|
||
|
from tests.common import MockConfigEntry
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def mock_config_entry() -> MockConfigEntry:
|
||
|
"""Return the default mocked config entry."""
|
||
|
return MockConfigEntry(
|
||
|
title="Home Assistant",
|
||
|
domain=DOMAIN,
|
||
|
data={
|
||
|
CONF_DOMAIN: "Home-Assistant.io",
|
||
|
},
|
||
|
unique_id="home-assistant.io",
|
||
|
)
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
||
|
"""Mock setting up a config entry."""
|
||
|
with patch(
|
||
|
"homeassistant.components.whois.async_setup_entry", return_value=True
|
||
|
) as mock_setup:
|
||
|
yield mock_setup
|