Fix Bang & Olufsen testing typing (#125427)

* Fix test parameter typed as callable instead of context manager

* Add missing AsyncMock typing
This commit is contained in:
Markus Jacobsen 2024-09-08 12:18:32 +02:00 committed by GitHub
parent 74b78307ee
commit 943b96e7a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,6 @@
"""Test the Bang & Olufsen media_player entity."""
from collections.abc import Callable
from contextlib import nullcontext as does_not_raise
from contextlib import AbstractContextManager, nullcontext as does_not_raise
import logging
from unittest.mock import AsyncMock, patch
@ -150,7 +149,9 @@ async def test_async_update_sources_outdated_api(
async def test_async_update_sources_remote(
hass: HomeAssistant, mock_mozart_client, mock_config_entry: MockConfigEntry
hass: HomeAssistant,
mock_mozart_client: AsyncMock,
mock_config_entry: MockConfigEntry,
) -> None:
"""Test _async_update_sources is called when there are new video sources."""
@ -595,7 +596,7 @@ async def test_async_media_seek(
mock_mozart_client: AsyncMock,
mock_config_entry: MockConfigEntry,
source: Source,
expected_result: Callable,
expected_result: AbstractContextManager,
seek_called_times: int,
) -> None:
"""Test async_media_seek."""
@ -681,7 +682,7 @@ async def test_async_select_source(
mock_mozart_client: AsyncMock,
mock_config_entry: MockConfigEntry,
source: str,
expected_result: Callable,
expected_result: AbstractContextManager,
audio_source_call: int,
video_source_call: int,
) -> None: