mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Move fixtures to decorators in netgear_lte tests (#119882)
This commit is contained in:
parent
f5fd389512
commit
a1a8d38181
@ -4,6 +4,7 @@ from datetime import timedelta
|
||||
from unittest.mock import patch
|
||||
|
||||
from eternalegypt.eternalegypt import Error
|
||||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.components.netgear_lte.const import DOMAIN
|
||||
@ -18,7 +19,8 @@ from .conftest import CONF_DATA
|
||||
from tests.common import async_fire_time_changed
|
||||
|
||||
|
||||
async def test_setup_unload(hass: HomeAssistant, setup_integration: None) -> None:
|
||||
@pytest.mark.usefixtures("setup_integration")
|
||||
async def test_setup_unload(hass: HomeAssistant) -> None:
|
||||
"""Test setup and unload."""
|
||||
entry = hass.config_entries.async_entries(DOMAIN)[0]
|
||||
assert entry.state is ConfigEntryState.LOADED
|
||||
@ -31,19 +33,18 @@ async def test_setup_unload(hass: HomeAssistant, setup_integration: None) -> Non
|
||||
assert not hass.data.get(DOMAIN)
|
||||
|
||||
|
||||
async def test_async_setup_entry_not_ready(
|
||||
hass: HomeAssistant, setup_cannot_connect: None
|
||||
) -> None:
|
||||
@pytest.mark.usefixtures("setup_cannot_connect")
|
||||
async def test_async_setup_entry_not_ready(hass: HomeAssistant) -> None:
|
||||
"""Test that it throws ConfigEntryNotReady when exception occurs during setup."""
|
||||
entry = hass.config_entries.async_entries(DOMAIN)[0]
|
||||
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
|
||||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("setup_integration")
|
||||
async def test_device(
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
setup_integration: None,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test device info."""
|
||||
@ -53,11 +54,8 @@ async def test_device(
|
||||
assert device == snapshot
|
||||
|
||||
|
||||
async def test_update_failed(
|
||||
hass: HomeAssistant,
|
||||
entity_registry_enabled_by_default: None,
|
||||
setup_integration: None,
|
||||
) -> None:
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "setup_integration")
|
||||
async def test_update_failed(hass: HomeAssistant) -> None:
|
||||
"""Test coordinator throws UpdateFailed after failed update."""
|
||||
with patch(
|
||||
"homeassistant.components.netgear_lte.eternalegypt.Modem.information",
|
||||
|
Loading…
x
Reference in New Issue
Block a user