2023-04-12 09:05:24 +00:00
|
|
|
"""Test fixtures for Brottplatskartan."""
|
2024-03-08 13:50:25 +00:00
|
|
|
|
2024-07-01 09:58:49 +00:00
|
|
|
from collections.abc import Generator
|
2023-04-12 09:05:24 +00:00
|
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2024-06-06 15:24:22 +00:00
|
|
|
def mock_setup_entry() -> Generator[AsyncMock]:
|
2023-04-12 09:05:24 +00:00
|
|
|
"""Override async_setup_entry."""
|
|
|
|
with patch(
|
|
|
|
"homeassistant.components.brottsplatskartan.async_setup_entry",
|
|
|
|
return_value=True,
|
|
|
|
) as mock_setup_entry:
|
|
|
|
yield mock_setup_entry
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
2024-06-06 15:24:22 +00:00
|
|
|
def uuid_generator() -> Generator[AsyncMock]:
|
2023-04-12 09:05:24 +00:00
|
|
|
"""Generate uuid for app-id."""
|
|
|
|
with patch(
|
|
|
|
"homeassistant.components.brottsplatskartan.config_flow.uuid.getnode",
|
|
|
|
return_value="1234567890",
|
|
|
|
) as uuid_generator:
|
|
|
|
yield uuid_generator
|