core/tests/components/axis/test_camera.py

31 lines
852 B
Python
Raw Normal View History

"""Axis camera platform tests."""
from homeassistant.components import axis
import homeassistant.components.camera as camera
from homeassistant.setup import async_setup_component
2020-01-02 23:02:59 +00:00
from .test_device import NAME, setup_axis_integration
async def test_platform_manually_configured(hass):
"""Test that nothing happens when platform is manually configured."""
2019-07-31 19:25:30 +00:00
assert (
await async_setup_component(
hass, camera.DOMAIN, {"camera": {"platform": axis.DOMAIN}}
)
is True
)
assert axis.DOMAIN not in hass.data
async def test_camera(hass):
"""Test that Axis camera platform is loaded properly."""
2020-01-02 23:02:59 +00:00
await setup_axis_integration(hass)
2020-01-02 23:02:59 +00:00
assert len(hass.states.async_entity_ids("camera")) == 1
2020-01-02 23:02:59 +00:00
cam = hass.states.get(f"camera.{NAME}")
2019-07-31 19:25:30 +00:00
assert cam.state == "idle"
2020-01-02 23:02:59 +00:00
assert cam.name == NAME