hass-core/tests/components/buienradar/test_sensor.py
Ties de Kock a05144bb8b Fix buienradar component and add smoke tests (#27965)
* Fixes the buienradar component and add smoke tests

  * Fix errors due to circular imports after imports were moved.
  * Add smoke test so this situation will be caught in the future.

* Add buienradar.util to coveragerc

* Refactor tests to standalone pytest test function style

* Add __init__ to buienradar tests
2019-10-21 13:52:25 +02:00

26 lines
749 B
Python

"""The tests for the Buienradar sensor platform."""
from homeassistant.setup import async_setup_component
from homeassistant.components import sensor
CONDITIONS = ["stationname", "temperature"]
BASE_CONFIG = {
"sensor": [
{
"platform": "buienradar",
"name": "volkel",
"latitude": 51.65,
"longitude": 5.7,
"monitored_conditions": CONDITIONS,
}
]
}
async def test_smoke_test_setup_component(hass):
"""Smoke test for successfully set-up with default config."""
assert await async_setup_component(hass, sensor.DOMAIN, BASE_CONFIG)
for cond in CONDITIONS:
state = hass.states.get(f"sensor.volkel_{cond}")
assert state.state == "unknown"