Remove 1-Wire SysBus (ADR-0019) (#71232)
This commit is contained in:
parent
30fdfc454f
commit
08856cfab0
22 changed files with 142 additions and 909 deletions
|
@ -1,5 +1,4 @@
|
|||
"""Tests for 1-Wire config flow."""
|
||||
import logging
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from pyownet import protocol
|
||||
|
@ -11,7 +10,7 @@ from homeassistant.core import HomeAssistant
|
|||
|
||||
|
||||
@pytest.mark.usefixtures("owproxy_with_connerror")
|
||||
async def test_owserver_connect_failure(hass: HomeAssistant, config_entry: ConfigEntry):
|
||||
async def test_connect_failure(hass: HomeAssistant, config_entry: ConfigEntry):
|
||||
"""Test connection failure raises ConfigEntryNotReady."""
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
@ -21,7 +20,7 @@ async def test_owserver_connect_failure(hass: HomeAssistant, config_entry: Confi
|
|||
assert not hass.data.get(DOMAIN)
|
||||
|
||||
|
||||
async def test_owserver_listing_failure(
|
||||
async def test_listing_failure(
|
||||
hass: HomeAssistant, config_entry: ConfigEntry, owproxy: MagicMock
|
||||
):
|
||||
"""Test listing failure raises ConfigEntryNotReady."""
|
||||
|
@ -49,34 +48,3 @@ async def test_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry):
|
|||
|
||||
assert config_entry.state is ConfigEntryState.NOT_LOADED
|
||||
assert not hass.data.get(DOMAIN)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("sysbus")
|
||||
async def test_warning_no_devices(
|
||||
hass: HomeAssistant,
|
||||
sysbus_config_entry: ConfigEntry,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
):
|
||||
"""Test warning is generated when no sysbus devices found."""
|
||||
with caplog.at_level(logging.WARNING, logger="homeassistant.components.onewire"):
|
||||
await hass.config_entries.async_setup(sysbus_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
assert "No onewire sensor found. Check if dtoverlay=w1-gpio" in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("sysbus")
|
||||
async def test_unload_sysbus_entry(
|
||||
hass: HomeAssistant, sysbus_config_entry: ConfigEntry
|
||||
):
|
||||
"""Test being able to unload an entry."""
|
||||
await hass.config_entries.async_setup(sysbus_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
|
||||
assert sysbus_config_entry.state is ConfigEntryState.LOADED
|
||||
|
||||
assert await hass.config_entries.async_unload(sysbus_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert sysbus_config_entry.state is ConfigEntryState.NOT_LOADED
|
||||
assert not hass.data.get(DOMAIN)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue