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

Simplify cloud request connection handling (#56243)

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
This commit is contained in:
Paulus Schoutsen
2021-09-22 07:51:31 -07:00
committed by GitHub
parent ac053388b4
commit e34c985534
9 changed files with 41 additions and 16 deletions

View File

@@ -549,14 +549,8 @@ async def test_enabling_remote(hass, hass_ws_client, setup_api, mock_cloud_login
assert len(mock_connect.mock_calls) == 1
async def test_disabling_remote(hass, hass_ws_client, setup_api, mock_cloud_login):
"""Test we call right code to disable remote UI."""
client = await hass_ws_client(hass)
cloud = hass.data[DOMAIN]
with patch("hass_nabucasa.remote.RemoteUI.disconnect") as mock_disconnect:
await client.send_json({"id": 5, "type": "cloud/remote/disconnect"})
await client.send_json({"id": 6, "type": "cloud/remote/disconnect"})
response = await client.receive_json()
assert response["success"]
assert not cloud.client.remote_autostart