* Brottsplatskartan Config Flow * Fix import * Modify sensor * Mod version * Mod version 2 * has_entity_name * Fix api constructor * Switch to issue for depr. * Fix docstrings * Minor cleaning * Fix argument for bpk constructor * remove translations * Fix tests * reset config * uuid to conftest * hassfest * depr version * unique id * reset not linked changes * review comments * fix area none * relevant changes * depr version * slim test * unique_id * create_entry * review comments and tests * fix init test * review comments
25 lines
737 B
Python
25 lines
737 B
Python
"""Test fixtures for Brottplatskartan."""
|
|
from collections.abc import Generator
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
|
"""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)
|
|
def uuid_generator() -> Generator[AsyncMock, None, None]:
|
|
"""Generate uuid for app-id."""
|
|
with patch(
|
|
"homeassistant.components.brottsplatskartan.config_flow.uuid.getnode",
|
|
return_value="1234567890",
|
|
) as uuid_generator:
|
|
yield uuid_generator
|