Remove config import from netatmo (#107972)

* Remove config import from netatmo

* Fix tests
This commit is contained in:
G Johansson 2024-01-16 22:17:18 +01:00 committed by GitHub
parent 0a758882e1
commit 7dffc9f515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 81 deletions

View file

@ -5,12 +5,32 @@ from unittest.mock import AsyncMock, patch
from pyatmo.const import ALL_SCOPES
import pytest
from homeassistant.components.application_credentials import (
ClientCredential,
async_import_client_credential,
)
from homeassistant.components.netatmo.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from .common import fake_get_image, fake_post_request
from tests.common import MockConfigEntry
CLIENT_ID = "1234"
CLIENT_SECRET = "5678"
@pytest.fixture(autouse=True)
async def setup_credentials(hass: HomeAssistant) -> None:
"""Fixture to setup credentials."""
assert await async_setup_component(hass, "application_credentials", {})
await async_import_client_credential(
hass,
DOMAIN,
ClientCredential(CLIENT_ID, CLIENT_SECRET),
)
@pytest.fixture(name="config_entry")
def mock_config_entry_fixture(hass: HomeAssistant) -> MockConfigEntry: