Use eventloop for scheduling (#37184)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
J. Nick KostonandPaulus Schoutsen authored and GitHub committed 2020-06-29 09:39:24 -07:00
1 parent 0f72008090
commit 89a9634d35
42 files changed
+366 -272

No files matched your search

+6 -3
View File
@@ -11,7 +11,7 @@ from tests.common import assert_setup_component, load_fixture
NOW = datetime(2016, 6, 9, 1, tzinfo=dt_util.UTC)
async def test_default_setup(hass, aioclient_mock):
async def test_default_setup(hass, legacy_patchable_time, aioclient_mock):
"""Test the default setup."""
aioclient_mock.get(
"https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/",
@@ -19,6 +19,7 @@ async def test_default_setup(hass, aioclient_mock):
)
config = {"platform": "yr", "elevation": 0}
hass.allow_pool = True
with patch(
"homeassistant.components.yr.sensor.dt_util.utcnow", return_value=NOW
), assert_setup_component(1):
@@ -31,7 +32,7 @@ async def test_default_setup(hass, aioclient_mock):
assert state.attributes.get("unit_of_measurement") is None
async def test_custom_setup(hass, aioclient_mock):
async def test_custom_setup(hass, legacy_patchable_time, aioclient_mock):
"""Test a custom setup."""
aioclient_mock.get(
"https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/",
@@ -50,6 +51,7 @@ async def test_custom_setup(hass, aioclient_mock):
],
}
hass.allow_pool = True
with patch(
"homeassistant.components.yr.sensor.dt_util.utcnow", return_value=NOW
), assert_setup_component(1):
@@ -77,7 +79,7 @@ async def test_custom_setup(hass, aioclient_mock):
assert state.state == "3.5"
async def test_forecast_setup(hass, aioclient_mock):
async def test_forecast_setup(hass, legacy_patchable_time, aioclient_mock):
"""Test a custom setup with 24h forecast."""
aioclient_mock.get(
"https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/",
@@ -97,6 +99,7 @@ async def test_forecast_setup(hass, aioclient_mock):
],
}
hass.allow_pool = True
with patch(
"homeassistant.components.yr.sensor.dt_util.utcnow", return_value=NOW
), assert_setup_component(1):