* Differentiate between device info types * Update allowed fields * Update homeassistant/helpers/entity_platform.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Split up message in 2 lines * Use dict for device info types * Extract device info function and test error checking * Simplify parsing device info * move checks around * Simplify more * Move error checking around * Fix order * fallback config entry title to domain * Remove fallback for name to config entry domain * Ensure mocked configuration URLs are strings * one more test case * Apply suggestions from code review Co-authored-by: Erik Montnemery <erik@montnemery.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Erik Montnemery <erik@montnemery.com>
14 lines
440 B
Python
14 lines
440 B
Python
"""Fixtures for the AVM Fritz!Box integration."""
|
|
from unittest.mock import Mock, patch
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(name="fritz")
|
|
def fritz_fixture() -> Mock:
|
|
"""Patch libraries."""
|
|
with patch("homeassistant.components.fritzbox.Fritzhome") as fritz, patch(
|
|
"homeassistant.components.fritzbox.config_flow.Fritzhome"
|
|
):
|
|
fritz.return_value.get_prefixed_host.return_value = "http://1.2.3.4"
|
|
yield fritz
|