Fix Freebox disk free space sensor (#99757)
* Fix Freebox disk free space sensor * Add initial value assert to check results
This commit is contained in:
parent
e1f4a3fa9f
commit
1a22ab77e1
5 changed files with 85 additions and 8 deletions
27
tests/components/freebox/common.py
Normal file
27
tests/components/freebox/common.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
"""Common methods used across tests for Freebox."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components.freebox.const import DOMAIN
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .const import MOCK_HOST, MOCK_PORT
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
async def setup_platform(hass: HomeAssistant, platform: str) -> MockConfigEntry:
|
||||
"""Set up the Freebox platform."""
|
||||
mock_entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
data={CONF_HOST: MOCK_HOST, CONF_PORT: MOCK_PORT},
|
||||
unique_id=MOCK_HOST,
|
||||
)
|
||||
mock_entry.add_to_hass(hass)
|
||||
|
||||
with patch("homeassistant.components.freebox.PLATFORMS", [platform]):
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
return mock_entry
|
Loading…
Add table
Add a link
Reference in a new issue