1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Use recorder_mock in tests (#70363)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Erik Montnemery
2022-04-23 07:29:44 +02:00
committed by GitHub
parent 16ca038f12
commit 982e314de6
43 changed files with 220 additions and 366 deletions

View File

@@ -3,7 +3,7 @@ from __future__ import annotations
import asyncio
from collections import OrderedDict
from collections.abc import Awaitable, Collection
from collections.abc import Awaitable, Callable, Collection
from contextlib import contextmanager
from datetime import datetime, timedelta
import functools as ft
@@ -896,6 +896,9 @@ def assert_setup_component(count, domain=None):
), f"setup_component failed, expected {count} got {res_len}: {res}"
SetupRecorderInstanceT = Callable[..., Awaitable[recorder.Recorder]]
def init_recorder_component(hass, add_config=None):
"""Initialize the recorder."""
config = dict(add_config) if add_config else {}