Remove Nest code related to Works with Nest API removal (#130785)

This commit is contained in:
Allen Porter
2024-11-16 20:07:00 -08:00
committed by GitHub
parent d8dd6d6abe
commit b64f33e1d7
6 changed files with 33 additions and 170 deletions

View File

@@ -24,22 +24,16 @@ import pytest
from homeassistant.components.nest import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from .common import (
PROJECT_ID,
SUBSCRIBER_ID,
TEST_CONFIG_ENTRY_LEGACY,
TEST_CONFIG_LEGACY,
TEST_CONFIG_NEW_SUBSCRIPTION,
TEST_CONFIGFLOW_APP_CREDS,
FakeSubscriber,
PlatformSetup,
YieldFixture,
)
from tests.common import MockConfigEntry
PLATFORM = "sensor"
@@ -201,18 +195,6 @@ async def test_subscriber_configuration_failure(
assert entries[0].state is ConfigEntryState.SETUP_ERROR
@pytest.mark.parametrize("nest_test_config", [TEST_CONFIGFLOW_APP_CREDS])
async def test_empty_config(
hass: HomeAssistant, error_caplog: pytest.LogCaptureFixture, config, setup_platform
) -> None:
"""Test setup is a no-op with not config."""
await setup_platform()
assert not error_caplog.records
entries = hass.config_entries.async_entries(DOMAIN)
assert len(entries) == 0
async def test_unload_entry(hass: HomeAssistant, setup_platform) -> None:
"""Test successful unload of a ConfigEntry."""
await setup_platform()
@@ -318,26 +300,3 @@ async def test_migrate_unique_id(
assert config_entry.state is ConfigEntryState.LOADED
assert config_entry.unique_id == PROJECT_ID
@pytest.mark.parametrize("nest_test_config", [TEST_CONFIG_LEGACY])
async def test_legacy_works_with_nest_yaml(
hass: HomeAssistant,
config: dict[str, Any],
config_entry: MockConfigEntry,
) -> None:
"""Test integration won't start with legacy works with nest yaml config."""
config_entry.add_to_hass(hass)
assert not await async_setup_component(hass, DOMAIN, config)
await hass.async_block_till_done()
@pytest.mark.parametrize("nest_test_config", [TEST_CONFIG_ENTRY_LEGACY])
async def test_legacy_works_with_nest_cleanup(
hass: HomeAssistant, setup_platform
) -> None:
"""Test legacy works with nest config entries are silently removed once yaml is removed."""
await setup_platform()
entries = hass.config_entries.async_entries(DOMAIN)
assert len(entries) == 0