1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

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
8 changed files with 108 additions and 123 deletions

View File

@@ -1,6 +1,5 @@
"""Axis light platform tests."""
from collections.abc import Callable
from typing import Any
from unittest.mock import patch
@@ -18,6 +17,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from .conftest import RtspEventMock
from .const import DEFAULT_HOST, NAME
API_DISCOVERY_LIGHT_CONTROL = {
@@ -72,7 +72,7 @@ def light_control_fixture(light_control_items: list[dict[str, Any]]) -> None:
@pytest.mark.usefixtures("config_entry_setup")
async def test_no_light_entity_without_light_control_representation(
hass: HomeAssistant,
mock_rtsp_event: Callable[[str, str, str, str, str, str], None],
mock_rtsp_event: RtspEventMock,
) -> None:
"""Verify no lights entities get created without light control representation."""
mock_rtsp_event(
@@ -89,10 +89,7 @@ async def test_no_light_entity_without_light_control_representation(
@pytest.mark.parametrize("api_discovery_items", [API_DISCOVERY_LIGHT_CONTROL])
@pytest.mark.usefixtures("config_entry_setup")
async def test_lights(
hass: HomeAssistant,
mock_rtsp_event: Callable[[str, str, str, str, str, str], None],
) -> None:
async def test_lights(hass: HomeAssistant, mock_rtsp_event: RtspEventMock) -> None:
"""Test that lights are loaded properly."""
# Add light
respx.post(