1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 06:28:31 +00:00

Move None bluetooth fixtures to decorator (#118802)

This commit is contained in:
epenet
2024-06-04 16:26:07 +02:00
committed by GitHub
parent f120f55d86
commit 80975d7a63
12 changed files with 253 additions and 230 deletions

View File

@@ -33,11 +33,9 @@ from tests.common import async_fire_time_changed
ONE_HOUR_SECONDS = 3600
@pytest.mark.usefixtures("enable_bluetooth", "macos_adapter")
async def test_advertisment_interval_shorter_than_adapter_stack_timeout(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_bluetooth: None,
macos_adapter: None,
) -> None:
"""Test we can determine the advertisement interval."""
start_monotonic_time = time.monotonic()
@@ -83,11 +81,9 @@ async def test_advertisment_interval_shorter_than_adapter_stack_timeout(
switchbot_device_unavailable_cancel()
@pytest.mark.usefixtures("enable_bluetooth", "macos_adapter")
async def test_advertisment_interval_longer_than_adapter_stack_timeout_connectable(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_bluetooth: None,
macos_adapter: None,
) -> None:
"""Test device with a long advertisement interval."""
start_monotonic_time = time.monotonic()
@@ -135,11 +131,9 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_connectab
switchbot_device_unavailable_cancel()
@pytest.mark.usefixtures("enable_bluetooth", "macos_adapter")
async def test_advertisment_interval_longer_than_adapter_stack_timeout_adapter_change_connectable(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_bluetooth: None,
macos_adapter: None,
) -> None:
"""Test device with a long advertisement interval with an adapter change."""
start_monotonic_time = time.monotonic()
@@ -200,11 +194,9 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_adapter_c
switchbot_device_unavailable_cancel()
@pytest.mark.usefixtures("enable_bluetooth", "macos_adapter")
async def test_advertisment_interval_longer_than_adapter_stack_timeout_not_connectable(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_bluetooth: None,
macos_adapter: None,
) -> None:
"""Test device with a long advertisement interval that is not connectable not reaching the advertising interval."""
start_monotonic_time = time.monotonic()
@@ -255,11 +247,9 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_not_conne
switchbot_device_unavailable_cancel()
@pytest.mark.usefixtures("enable_bluetooth", "macos_adapter")
async def test_advertisment_interval_shorter_than_adapter_stack_timeout_adapter_change_not_connectable(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_bluetooth: None,
macos_adapter: None,
) -> None:
"""Test device with a short advertisement interval with an adapter change that is not connectable."""
start_monotonic_time = time.monotonic()
@@ -330,11 +320,9 @@ async def test_advertisment_interval_shorter_than_adapter_stack_timeout_adapter_
switchbot_device_unavailable_cancel()
@pytest.mark.usefixtures("enable_bluetooth", "macos_adapter")
async def test_advertisment_interval_longer_than_adapter_stack_timeout_adapter_change_not_connectable(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_bluetooth: None,
macos_adapter: None,
) -> None:
"""Test device with a long advertisement interval with an adapter change that is not connectable."""
start_monotonic_time = time.monotonic()
@@ -436,11 +424,9 @@ async def test_advertisment_interval_longer_than_adapter_stack_timeout_adapter_c
switchbot_device_unavailable_cancel()
@pytest.mark.usefixtures("enable_bluetooth", "macos_adapter")
async def test_advertisment_interval_longer_increasing_than_adapter_stack_timeout_adapter_change_not_connectable(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
enable_bluetooth: None,
macos_adapter: None,
) -> None:
"""Test device with a increasing advertisement interval with an adapter change that is not connectable."""
start_monotonic_time = time.monotonic()