Improve code coverage for HomematicIP Cloud (#27606)
* Improve tests for HomematicIP Cloud * create fixtures remove decorators * removed further decorators * remove last decorator * improve exception handling * removed not required coroutine * use the correct place for mock
This commit is contained in:
parent
57b8d1889a
commit
3d7860391a
16 changed files with 372 additions and 39 deletions
|
@ -1,15 +1,29 @@
|
|||
"""Tests for HomematicIP Cloud weather."""
|
||||
from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN
|
||||
from homeassistant.components.weather import (
|
||||
ATTR_WEATHER_ATTRIBUTION,
|
||||
ATTR_WEATHER_HUMIDITY,
|
||||
ATTR_WEATHER_TEMPERATURE,
|
||||
ATTR_WEATHER_WIND_BEARING,
|
||||
ATTR_WEATHER_WIND_SPEED,
|
||||
DOMAIN as WEATHER_DOMAIN,
|
||||
)
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .helper import async_manipulate_test_data, get_and_check_entity_basics
|
||||
|
||||
|
||||
async def test_manually_configured_platform(hass):
|
||||
"""Test that we do not set up an access point."""
|
||||
assert (
|
||||
await async_setup_component(
|
||||
hass, WEATHER_DOMAIN, {WEATHER_DOMAIN: {"platform": HMIPC_DOMAIN}}
|
||||
)
|
||||
is True
|
||||
)
|
||||
assert not hass.data.get(HMIPC_DOMAIN)
|
||||
|
||||
|
||||
async def test_hmip_weather_sensor(hass, default_mock_hap):
|
||||
"""Test HomematicipWeatherSensor."""
|
||||
entity_id = "weather.weather_sensor_plus"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue