1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Reflect changes to pydeconz v84 (#56361)

Mostly snake case conversions and typing
But also a change in retry mechanism
Added a more complete set_* call to most types to remove the direct relation to rest API of deCONZ
This commit is contained in:
Robert Svensson
2021-09-18 09:05:08 +02:00
committed by GitHub
parent 6947912fa9
commit 539ef31046
22 changed files with 87 additions and 85 deletions

View File

@@ -267,14 +267,14 @@ async def test_reset_after_successful_setup(hass, aioclient_mock):
async def test_get_gateway(hass):
"""Successful call."""
with patch("pydeconz.DeconzSession.initialize", return_value=True):
with patch("pydeconz.DeconzSession.refresh_state", return_value=True):
assert await get_gateway(hass, ENTRY_CONFIG, Mock(), Mock())
async def test_get_gateway_fails_unauthorized(hass):
"""Failed call."""
with patch(
"pydeconz.DeconzSession.initialize",
"pydeconz.DeconzSession.refresh_state",
side_effect=pydeconz.errors.Unauthorized,
), pytest.raises(AuthenticationRequired):
assert await get_gateway(hass, ENTRY_CONFIG, Mock(), Mock()) is False
@@ -283,7 +283,7 @@ async def test_get_gateway_fails_unauthorized(hass):
async def test_get_gateway_fails_cannot_connect(hass):
"""Failed call."""
with patch(
"pydeconz.DeconzSession.initialize",
"pydeconz.DeconzSession.refresh_state",
side_effect=pydeconz.errors.RequestError,
), pytest.raises(CannotConnect):
assert await get_gateway(hass, ENTRY_CONFIG, Mock(), Mock()) is False