mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
Add created sensor in filesize (#131108)
This commit is contained in:
@ -8,21 +8,30 @@ from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.filesize.const import DOMAIN
|
||||
from homeassistant.const import CONF_FILE_PATH
|
||||
from homeassistant.components.filesize.const import DOMAIN, PLATFORMS
|
||||
from homeassistant.const import CONF_FILE_PATH, Platform
|
||||
|
||||
from . import TEST_FILE_NAME
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.fixture(name="load_platforms")
|
||||
async def patch_platform_constant() -> list[Platform]:
|
||||
"""Return list of platforms to load."""
|
||||
return PLATFORMS
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_config_entry(tmp_path: Path) -> MockConfigEntry:
|
||||
def mock_config_entry(
|
||||
tmp_path: Path, load_platforms: list[Platform]
|
||||
) -> MockConfigEntry:
|
||||
"""Return the default mocked config entry."""
|
||||
test_file = str(tmp_path.joinpath(TEST_FILE_NAME))
|
||||
return MockConfigEntry(
|
||||
title=TEST_FILE_NAME,
|
||||
domain=DOMAIN,
|
||||
entry_id="01JD5CTQMH9FKEFQKZJ8MMBQ3X",
|
||||
data={CONF_FILE_PATH: test_file},
|
||||
unique_id=test_file,
|
||||
)
|
||||
|
Reference in New Issue
Block a user