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

Split reauth tests in plex (#89212)

This commit is contained in:
epenet
2023-03-06 10:02:32 +01:00
committed by GitHub
parent c7b30b61de
commit 0c65af93af
3 changed files with 64 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
"""Fixtures for Plex tests."""
from unittest.mock import patch
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
import pytest
@@ -18,6 +19,15 @@ def plex_server_url(entry):
return entry.data[PLEX_SERVER_CONFIG][CONF_URL].split(":", 1)[-1]
@pytest.fixture
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.plex.async_setup_entry", return_value=True
) as mock_setup_entry:
yield mock_setup_entry
@pytest.fixture(name="album", scope="session")
def album_fixture():
"""Load album payload and return it."""