mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Move socket_enabled fixture to decorator (#118847)
This commit is contained in:
parent
6de26ca811
commit
fb51163075
@ -186,9 +186,8 @@ async def test_pipeline_events(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_udp_server(
|
async def test_udp_server(
|
||||||
hass: HomeAssistant,
|
|
||||||
socket_enabled: None,
|
|
||||||
unused_udp_port_factory: Callable[[], int],
|
unused_udp_port_factory: Callable[[], int],
|
||||||
voice_assistant_udp_pipeline_v1: VoiceAssistantUDPPipeline,
|
voice_assistant_udp_pipeline_v1: VoiceAssistantUDPPipeline,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -313,9 +312,8 @@ async def test_error_calls_handle_finished(
|
|||||||
voice_assistant_udp_pipeline_v1.handle_finished.assert_called()
|
voice_assistant_udp_pipeline_v1.handle_finished.assert_called()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_udp_server_multiple(
|
async def test_udp_server_multiple(
|
||||||
hass: HomeAssistant,
|
|
||||||
socket_enabled: None,
|
|
||||||
unused_udp_port_factory: Callable[[], int],
|
unused_udp_port_factory: Callable[[], int],
|
||||||
voice_assistant_udp_pipeline_v1: VoiceAssistantUDPPipeline,
|
voice_assistant_udp_pipeline_v1: VoiceAssistantUDPPipeline,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -336,9 +334,8 @@ async def test_udp_server_multiple(
|
|||||||
await voice_assistant_udp_pipeline_v1.start_server()
|
await voice_assistant_udp_pipeline_v1.start_server()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_udp_server_after_stopped(
|
async def test_udp_server_after_stopped(
|
||||||
hass: HomeAssistant,
|
|
||||||
socket_enabled: None,
|
|
||||||
unused_udp_port_factory: Callable[[], int],
|
unused_udp_port_factory: Callable[[], int],
|
||||||
voice_assistant_udp_pipeline_v1: VoiceAssistantUDPPipeline,
|
voice_assistant_udp_pipeline_v1: VoiceAssistantUDPPipeline,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -62,6 +62,7 @@ async def setup_diag(hass):
|
|||||||
|
|
||||||
|
|
||||||
@freeze_time("2023-03-13 12:05:00-07:00")
|
@freeze_time("2023-03-13 12:05:00-07:00")
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_diagnostics(
|
async def test_diagnostics(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
component_setup: ComponentSetup,
|
component_setup: ComponentSetup,
|
||||||
@ -70,7 +71,6 @@ async def test_diagnostics(
|
|||||||
hass_admin_credential: Credentials,
|
hass_admin_credential: Credentials,
|
||||||
config_entry: MockConfigEntry,
|
config_entry: MockConfigEntry,
|
||||||
aiohttp_client: ClientSessionGenerator,
|
aiohttp_client: ClientSessionGenerator,
|
||||||
socket_enabled: None,
|
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
aioclient_mock: AiohttpClientMocker,
|
aioclient_mock: AiohttpClientMocker,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -320,10 +320,10 @@ async def test_api_ingress_panels(
|
|||||||
("update_diagnostics", "POST", True),
|
("update_diagnostics", "POST", True),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_api_headers(
|
async def test_api_headers(
|
||||||
aiohttp_raw_server, # 'aiohttp_raw_server' must be before 'hass'!
|
aiohttp_raw_server, # 'aiohttp_raw_server' must be before 'hass'!
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
socket_enabled: None,
|
|
||||||
api_call: str,
|
api_call: str,
|
||||||
method: Literal["GET", "POST"],
|
method: Literal["GET", "POST"],
|
||||||
payload: Any,
|
payload: Any,
|
||||||
|
@ -48,6 +48,7 @@ async def setup_diag(hass):
|
|||||||
|
|
||||||
|
|
||||||
@freeze_time("2023-03-13 12:05:00-07:00")
|
@freeze_time("2023-03-13 12:05:00-07:00")
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_empty_calendar(
|
async def test_empty_calendar(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
setup_integration: None,
|
setup_integration: None,
|
||||||
@ -55,7 +56,6 @@ async def test_empty_calendar(
|
|||||||
hass_admin_credential: Credentials,
|
hass_admin_credential: Credentials,
|
||||||
config_entry: MockConfigEntry,
|
config_entry: MockConfigEntry,
|
||||||
aiohttp_client: ClientSessionGenerator,
|
aiohttp_client: ClientSessionGenerator,
|
||||||
socket_enabled: None,
|
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test diagnostics against an empty calendar."""
|
"""Test diagnostics against an empty calendar."""
|
||||||
@ -76,6 +76,7 @@ async def test_empty_calendar(
|
|||||||
|
|
||||||
|
|
||||||
@freeze_time("2023-03-13 12:05:00-07:00")
|
@freeze_time("2023-03-13 12:05:00-07:00")
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_api_date_time_event(
|
async def test_api_date_time_event(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
setup_integration: None,
|
setup_integration: None,
|
||||||
@ -84,7 +85,6 @@ async def test_api_date_time_event(
|
|||||||
config_entry: MockConfigEntry,
|
config_entry: MockConfigEntry,
|
||||||
hass_ws_client: WebSocketGenerator,
|
hass_ws_client: WebSocketGenerator,
|
||||||
aiohttp_client: ClientSessionGenerator,
|
aiohttp_client: ClientSessionGenerator,
|
||||||
socket_enabled: None,
|
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test an event with a start/end date time."""
|
"""Test an event with a start/end date time."""
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from aiohttp.test_utils import TestClient
|
from aiohttp.test_utils import TestClient
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
|
import pytest
|
||||||
from syrupy import SnapshotAssertion
|
from syrupy import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.auth.models import Credentials
|
from homeassistant.auth.models import Credentials
|
||||||
@ -50,12 +51,12 @@ def limit_diagnostic_attrs(prop, path) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
@freeze_time("2024-04-06 00:00:00+00:00")
|
@freeze_time("2024-04-06 00:00:00+00:00")
|
||||||
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
async def test_diagnostics(
|
async def test_diagnostics(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
aiohttp_client: ClientSessionGenerator,
|
aiohttp_client: ClientSessionGenerator,
|
||||||
hass_admin_user: MockUser,
|
hass_admin_user: MockUser,
|
||||||
hass_admin_credential: Credentials,
|
hass_admin_credential: Credentials,
|
||||||
socket_enabled: None,
|
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test generating diagnostics for a config entry."""
|
"""Test generating diagnostics for a config entry."""
|
||||||
|
@ -9,7 +9,8 @@ from homeassistant.components import voip
|
|||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
|
||||||
async def test_create_sip_server(hass: HomeAssistant, socket_enabled: None) -> None:
|
@pytest.mark.usefixtures("socket_enabled")
|
||||||
|
async def test_create_sip_server(hass: HomeAssistant) -> None:
|
||||||
"""Tests starting/stopping SIP server."""
|
"""Tests starting/stopping SIP server."""
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
voip.DOMAIN, context={"source": config_entries.SOURCE_USER}
|
voip.DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user