2019-01-09 04:11:51 +00:00
|
|
|
"""The tests for the geolocation component."""
|
2018-10-12 14:48:02 +00:00
|
|
|
import pytest
|
|
|
|
|
2018-08-30 11:58:23 +00:00
|
|
|
from homeassistant.components import geo_location
|
2019-01-09 04:11:51 +00:00
|
|
|
from homeassistant.components.geo_location import GeolocationEvent
|
2018-08-30 11:58:23 +00:00
|
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
|
|
|
|
|
|
|
|
async def test_setup_component(hass):
|
|
|
|
"""Simple test setup of component."""
|
2019-04-14 23:59:06 +00:00
|
|
|
result = await async_setup_component(hass, geo_location.DOMAIN, {})
|
2018-08-30 11:58:23 +00:00
|
|
|
assert result
|
|
|
|
|
|
|
|
|
|
|
|
async def test_event(hass):
|
2019-01-09 04:11:51 +00:00
|
|
|
"""Simple test of the geolocation event class."""
|
|
|
|
entity = GeolocationEvent()
|
2018-08-30 11:58:23 +00:00
|
|
|
|
|
|
|
assert entity.state is None
|
|
|
|
assert entity.distance is None
|
|
|
|
assert entity.latitude is None
|
|
|
|
assert entity.longitude is None
|
2018-10-12 14:48:02 +00:00
|
|
|
with pytest.raises(NotImplementedError):
|
|
|
|
assert entity.source is None
|