mirror of
https://github.com/home-assistant/core.git
synced 2025-12-27 14:31:13 +00:00
Use HassKey in cloud integration (#120322)
This commit is contained in:
@@ -8,6 +8,7 @@ import pytest
|
||||
from homeassistant.components.alexa import errors
|
||||
from homeassistant.components.cloud import ALEXA_SCHEMA, alexa_config
|
||||
from homeassistant.components.cloud.const import (
|
||||
DATA_CLOUD,
|
||||
PREF_ALEXA_DEFAULT_EXPOSE,
|
||||
PREF_ALEXA_ENTITY_CONFIGS,
|
||||
PREF_SHOULD_EXPOSE,
|
||||
@@ -425,7 +426,7 @@ async def test_alexa_entity_registry_sync(
|
||||
expose_new(hass, True)
|
||||
|
||||
await alexa_config.CloudAlexaConfig(
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, hass.data["cloud"]
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, hass.data[DATA_CLOUD]
|
||||
).async_initialize()
|
||||
|
||||
with patch_sync_helper() as (to_update, to_remove):
|
||||
@@ -506,11 +507,11 @@ def test_enabled_requires_valid_sub(
|
||||
) -> None:
|
||||
"""Test that alexa config enabled requires a valid Cloud sub."""
|
||||
assert cloud_prefs.alexa_enabled
|
||||
assert hass.data["cloud"].is_logged_in
|
||||
assert hass.data["cloud"].subscription_expired
|
||||
assert hass.data[DATA_CLOUD].is_logged_in
|
||||
assert hass.data[DATA_CLOUD].subscription_expired
|
||||
|
||||
config = alexa_config.CloudAlexaConfig(
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, hass.data["cloud"]
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, hass.data[DATA_CLOUD]
|
||||
)
|
||||
|
||||
assert not config.enabled
|
||||
|
||||
Reference in New Issue
Block a user