1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +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 switch platform tests."""
from collections.abc import Callable
from unittest.mock import patch
from axis.models.api import CONTEXT
@@ -16,6 +15,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from .conftest import RtspEventMock
from .const import API_DISCOVERY_PORT_MANAGEMENT, NAME
PORT_DATA = """root.IOPort.I0.Configurable=yes
@@ -33,7 +33,7 @@ root.IOPort.I1.Output.Active=open
@pytest.mark.usefixtures("config_entry_setup")
async def test_switches_with_port_cgi(
hass: HomeAssistant,
mock_rtsp_event: Callable[[str, str, str, str, str, str], None],
mock_rtsp_event: RtspEventMock,
) -> None:
"""Test that switches are loaded properly using port.cgi."""
mock_rtsp_event(
@@ -118,7 +118,7 @@ PORT_MANAGEMENT_RESPONSE = {
@pytest.mark.usefixtures("config_entry_setup")
async def test_switches_with_port_management(
hass: HomeAssistant,
mock_rtsp_event: Callable[[str, str, str, str, str, str], None],
mock_rtsp_event: RtspEventMock,
) -> None:
"""Test that switches are loaded properly using port management."""
mock_rtsp_event(