Restructure and setup dedicated coordinator for Azure DevOps (#119199)

This commit is contained in:
Aidan Timson
2024-06-11 17:08:58 +01:00
committed by GitHub
parent a0abd537c6
commit c907912dd1
7 changed files with 208 additions and 95 deletions

View File

@@ -1,9 +1,9 @@
"""Test fixtures for Azure DevOps."""
from collections.abc import AsyncGenerator, Generator
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from typing_extensions import AsyncGenerator, Generator
from homeassistant.components.azure_devops.const import DOMAIN
@@ -18,7 +18,8 @@ async def mock_devops_client() -> AsyncGenerator[MagicMock]:
with (
patch(
"homeassistant.components.azure_devops.DevOpsClient", autospec=True
"homeassistant.components.azure_devops.coordinator.DevOpsClient",
autospec=True,
) as mock_client,
patch(
"homeassistant.components.azure_devops.config_flow.DevOpsClient",
@@ -54,5 +55,5 @@ def mock_setup_entry() -> Generator[AsyncMock]:
with patch(
"homeassistant.components.azure_devops.async_setup_entry",
return_value=True,
) as mock_setup_entry:
yield mock_setup_entry
) as mock_entry:
yield mock_entry