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

Fix google sync (#30524)

This commit is contained in:
Paulus Schoutsen
2020-01-06 22:00:39 +01:00
committed by GitHub
parent a84741392b
commit 05374d7c85
7 changed files with 39 additions and 7 deletions

View File

@@ -103,13 +103,17 @@ async def test_handler_google_actions(hass):
reqid = "5711642932632160983"
data = {"requestId": reqid, "inputs": [{"intent": "action.devices.SYNC"}]}
config = await cloud.client.get_google_config()
resp = await cloud.client.async_google_message(data)
with patch(
"hass_nabucasa.Cloud._decode_claims",
return_value={"cognito:username": "myUserName"},
):
await cloud.client.get_google_config()
resp = await cloud.client.async_google_message(data)
assert resp["requestId"] == reqid
payload = resp["payload"]
assert payload["agentUserId"] == config.cloud_user
assert payload["agentUserId"] == "myUserName"
devices = payload["devices"]
assert len(devices) == 1