mirror of
https://github.com/home-assistant/core.git
synced 2026-11-30 01:33:12 -04:00
Bump airly library to version 1.1.0 (#47163)
This commit is contained in:
@@ -18,7 +18,11 @@ async def test_airly_system_health(hass, aioclient_mock):
|
||||
|
||||
hass.data[DOMAIN] = {}
|
||||
hass.data[DOMAIN]["0123xyz"] = Mock(
|
||||
airly=Mock(AIRLY_API_URL="https://airapi.airly.eu/v2/")
|
||||
airly=Mock(
|
||||
AIRLY_API_URL="https://airapi.airly.eu/v2/",
|
||||
requests_remaining=42,
|
||||
requests_per_day=100,
|
||||
)
|
||||
)
|
||||
|
||||
info = await get_system_health_info(hass, DOMAIN)
|
||||
@@ -27,7 +31,9 @@ async def test_airly_system_health(hass, aioclient_mock):
|
||||
if asyncio.iscoroutine(val):
|
||||
info[key] = await val
|
||||
|
||||
assert info == {"can_reach_server": "ok"}
|
||||
assert info["can_reach_server"] == "ok"
|
||||
assert info["requests_remaining"] == 42
|
||||
assert info["requests_per_day"] == 100
|
||||
|
||||
|
||||
async def test_airly_system_health_fail(hass, aioclient_mock):
|
||||
@@ -38,7 +44,11 @@ async def test_airly_system_health_fail(hass, aioclient_mock):
|
||||
|
||||
hass.data[DOMAIN] = {}
|
||||
hass.data[DOMAIN]["0123xyz"] = Mock(
|
||||
airly=Mock(AIRLY_API_URL="https://airapi.airly.eu/v2/")
|
||||
airly=Mock(
|
||||
AIRLY_API_URL="https://airapi.airly.eu/v2/",
|
||||
requests_remaining=0,
|
||||
requests_per_day=1000,
|
||||
)
|
||||
)
|
||||
|
||||
info = await get_system_health_info(hass, DOMAIN)
|
||||
@@ -47,4 +57,6 @@ async def test_airly_system_health_fail(hass, aioclient_mock):
|
||||
if asyncio.iscoroutine(val):
|
||||
info[key] = await val
|
||||
|
||||
assert info == {"can_reach_server": {"type": "failed", "error": "unreachable"}}
|
||||
assert info["can_reach_server"] == {"type": "failed", "error": "unreachable"}
|
||||
assert info["requests_remaining"] == 0
|
||||
assert info["requests_per_day"] == 1000
|
||||
|
||||
Reference in New Issue
Block a user