mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Clean up Whois tests use entity_registry_enabled_by_default fixture (#68113)
This commit is contained in:
parent
fb703ddc5d
commit
a29afc3731
@ -124,13 +124,3 @@ async def init_integration_missing_some_attrs(
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
return mock_config_entry
|
return mock_config_entry
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def enable_all_entities() -> Generator[AsyncMock, None, None]:
|
|
||||||
"""Test fixture that ensures all entities are enabled in the registry."""
|
|
||||||
with patch(
|
|
||||||
"homeassistant.helpers.entity.Entity.entity_registry_enabled_default",
|
|
||||||
return_value=True,
|
|
||||||
) as mock_entity_registry_enabled_by_default:
|
|
||||||
yield mock_entity_registry_enabled_by_default
|
|
||||||
|
@ -22,7 +22,7 @@ from tests.common import MockConfigEntry, async_fire_time_changed
|
|||||||
@pytest.mark.freeze_time("2022-01-01 12:00:00", tz_offset=0)
|
@pytest.mark.freeze_time("2022-01-01 12:00:00", tz_offset=0)
|
||||||
async def test_whois_sensors(
|
async def test_whois_sensors(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
enable_all_entities: AsyncMock,
|
entity_registry_enabled_by_default: AsyncMock,
|
||||||
init_integration: MockConfigEntry,
|
init_integration: MockConfigEntry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test the Whois sensors."""
|
"""Test the Whois sensors."""
|
||||||
@ -146,7 +146,7 @@ async def test_whois_sensors(
|
|||||||
@pytest.mark.freeze_time("2022-01-01 12:00:00", tz_offset=0)
|
@pytest.mark.freeze_time("2022-01-01 12:00:00", tz_offset=0)
|
||||||
async def test_whois_sensors_missing_some_attrs(
|
async def test_whois_sensors_missing_some_attrs(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
enable_all_entities: AsyncMock,
|
entity_registry_enabled_by_default: AsyncMock,
|
||||||
init_integration_missing_some_attrs: MockConfigEntry,
|
init_integration_missing_some_attrs: MockConfigEntry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test the Whois sensors with owner and reseller missing."""
|
"""Test the Whois sensors with owner and reseller missing."""
|
||||||
@ -213,7 +213,7 @@ async def test_disabled_by_default_sensors(
|
|||||||
async def test_no_data(
|
async def test_no_data(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_whois: MagicMock,
|
mock_whois: MagicMock,
|
||||||
enable_all_entities: AsyncMock,
|
entity_registry_enabled_by_default: AsyncMock,
|
||||||
init_integration: MockConfigEntry,
|
init_integration: MockConfigEntry,
|
||||||
entity_id: str,
|
entity_id: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user