2021-02-24 03:34:27 -05:00
|
|
|
"""Configure py.test."""
|
2021-04-05 13:39:39 -04:00
|
|
|
import json
|
2021-02-24 03:34:27 -05:00
|
|
|
from unittest.mock import patch
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2021-04-05 13:39:39 -04:00
|
|
|
from tests.common import load_fixture
|
|
|
|
|
2021-02-24 03:34:27 -05:00
|
|
|
|
|
|
|
@pytest.fixture(name="climacell_config_entry_update")
|
|
|
|
def climacell_config_entry_update_fixture():
|
|
|
|
"""Mock valid climacell config entry setup."""
|
|
|
|
with patch(
|
2021-04-05 13:39:39 -04:00
|
|
|
"homeassistant.components.climacell.ClimaCellV3.realtime",
|
2022-03-19 03:42:22 -04:00
|
|
|
return_value=json.loads(load_fixture("v3_realtime.json", "climacell")),
|
2021-04-05 13:39:39 -04:00
|
|
|
), patch(
|
|
|
|
"homeassistant.components.climacell.ClimaCellV3.forecast_hourly",
|
2022-03-19 03:42:22 -04:00
|
|
|
return_value=json.loads(load_fixture("v3_forecast_hourly.json", "climacell")),
|
2021-02-24 03:34:27 -05:00
|
|
|
), patch(
|
2021-04-05 13:39:39 -04:00
|
|
|
"homeassistant.components.climacell.ClimaCellV3.forecast_daily",
|
2022-03-19 03:42:22 -04:00
|
|
|
return_value=json.loads(load_fixture("v3_forecast_daily.json", "climacell")),
|
2021-02-24 03:34:27 -05:00
|
|
|
), patch(
|
2021-04-05 13:39:39 -04:00
|
|
|
"homeassistant.components.climacell.ClimaCellV3.forecast_nowcast",
|
2022-03-19 03:42:22 -04:00
|
|
|
return_value=json.loads(load_fixture("v3_forecast_nowcast.json", "climacell")),
|
2021-02-24 03:34:27 -05:00
|
|
|
):
|
|
|
|
yield
|