mirror of
https://github.com/home-assistant/core.git
synced 2026-05-30 20:24:21 +01:00
a6a6a7b69c
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
23 lines
606 B
Python
23 lines
606 B
Python
"""Fixtures for tests."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
import pytest
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .common import ComponentFactory
|
|
|
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
|
|
|
|
|
@pytest.fixture()
|
|
def component_factory(
|
|
hass: HomeAssistant, aiohttp_client, aioclient_mock: AiohttpClientMocker
|
|
):
|
|
"""Return a factory for initializing the withings component."""
|
|
with patch(
|
|
"homeassistant.components.withings.common.ConfigEntryWithingsApi"
|
|
) as api_class_mock:
|
|
yield ComponentFactory(hass, api_class_mock, aiohttp_client, aioclient_mock)
|