Files
core/tests/components/metoffice/conftest.py
avee87 4f24d63de1 Update metoffice to use DataHub API (#131425)
* Update metoffice to use DataHub API

* Reauth test

* Updated to datapoint 0.11.0

* Less hacky check for day/night in twice-daily forecasts

* Updated to datapoint 0.12.1, added daily forecast

* addressed review comments

* one more nit

* validate credewntials in reauth flow

* Addressed review comments

* Attempt to improve coverage

* Addressed comments

* Reverted unnecessary reordering

* Update homeassistant/components/metoffice/sensor.py

* Update tests/components/metoffice/test_sensor.py

* Update homeassistant/components/metoffice/sensor.py

---------

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-05-21 21:56:32 +02:00

23 lines
653 B
Python

"""Fixtures for Met Office weather integration tests."""
from unittest.mock import patch
from datapoint.exceptions import APIException
import pytest
@pytest.fixture
def mock_simple_manager_fail():
"""Mock datapoint Manager with default values for testing in config_flow."""
with patch("datapoint.Manager.Manager") as mock_manager:
instance = mock_manager.return_value
instance.get_forecast = APIException()
instance.latitude = None
instance.longitude = None
instance.site = None
instance.site_id = None
instance.site_name = None
instance.now = None
yield mock_manager