Remove config import from netatmo (#107972)
* Remove config import from netatmo * Fix tests
This commit is contained in:
parent
0a758882e1
commit
7dffc9f515
3 changed files with 26 additions and 81 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue