core/tests/components/opensky/__init__.py

20 lines
528 B
Python
Raw Normal View History

"""Opensky tests."""
from unittest.mock import patch
2023-08-22 16:06:19 +00:00
from python_opensky import StatesResponse
2023-10-22 20:00:14 +00:00
from tests.common import load_json_object_fixture
2023-08-22 16:06:19 +00:00
def patch_setup_entry() -> bool:
"""Patch interface."""
return patch(
"homeassistant.components.opensky.async_setup_entry", return_value=True
)
2023-08-22 16:06:19 +00:00
def get_states_response_fixture(fixture: str) -> StatesResponse:
"""Return the states response from json."""
2023-10-22 20:00:14 +00:00
states_json = load_json_object_fixture(fixture)
return StatesResponse.from_api(states_json)