Tweak axis test fixtures (#122469)

* Don't automatically add config entry to hass

* Improve RTSP fixture typing

* Improve typing of config entry factory and remove unnecessary use of it

* Remove redundant fixture in config flow tests

* Parametrize config flow error test
This commit is contained in:
Robert Svensson 2024-07-23 19:27:38 +02:00 committed by GitHub
parent 1b7fb9ae12
commit b53800a69d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 108 additions and 123 deletions

View file

@ -1,7 +1,5 @@
"""Axis camera platform tests."""
from collections.abc import Callable
import pytest
from homeassistant.components import camera
@ -10,7 +8,6 @@ from homeassistant.components.axis.const import (
DOMAIN as AXIS_DOMAIN,
)
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_IDLE
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
@ -82,13 +79,11 @@ root.Properties.Firmware.BuildDate=Feb 15 2019 09:42
root.Properties.Firmware.BuildNumber=26
root.Properties.Firmware.Version=9.10.1
root.Properties.System.SerialNumber={MAC}
"""
""" # No image format data to signal camera support
@pytest.mark.parametrize("param_properties_payload", [PROPERTY_DATA])
async def test_camera_disabled(
hass: HomeAssistant, config_entry_factory: Callable[[], ConfigEntry]
) -> None:
@pytest.mark.usefixtures("config_entry_setup")
async def test_camera_disabled(hass: HomeAssistant) -> None:
"""Test that Axis camera platform is loaded properly but does not create camera entity."""
await config_entry_factory()
assert len(hass.states.async_entity_ids(CAMERA_DOMAIN)) == 0